comments only
[ghc-hetmet.git] / rts / sm / BlockAlloc.c
index edc3762..484c0d4 100644 (file)
@@ -26,9 +26,6 @@
 
 static void  initMBlock(void *mblock);
 
-// The free_list is kept sorted by size, smallest first.
-// In THREADED_RTS mode, the free list is protected by sm_mutex.
-
 /* -----------------------------------------------------------------------------
 
   Implementation notes
@@ -71,7 +68,7 @@ static void  initMBlock(void *mblock);
   ~~~~~~~~~~
 
   Preliminaries:
-    - most allocations are for small blocks
+    - most allocations are for a small number of blocks
     - sometimes the OS gives us new memory backwards in the address
       space, sometimes forwards, so we should not be biased towards
       any particular layout in the address space
@@ -123,6 +120,8 @@ static void  initMBlock(void *mblock);
 
 #define MAX_FREE_LIST 9
 
+// In THREADED_RTS mode, the free list is protected by sm_mutex.
+
 static bdescr *free_list[MAX_FREE_LIST];
 static bdescr *free_mblock_list;
 
@@ -283,7 +282,7 @@ alloc_mega_group (nat mblocks)
     if (best)
     {
         // we take our chunk off the end here.
-        nat best_mblocks  = BLOCKS_TO_MBLOCKS(best->blocks);
+        StgWord best_mblocks  = BLOCKS_TO_MBLOCKS(best->blocks);
         bd = FIRST_BDESCR((StgWord8*)MBLOCK_ROUND_DOWN(best) + 
                           (best_mblocks-mblocks)*MBLOCK_SIZE);