X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fsm%2FBlockAlloc.c;h=484c0d447520b227cb8e4638aaa881c715119298;hb=897231aa5f150bfb11d1715b2dc5c9ac32be4af6;hp=edc37620bda566dde53d17529f3c67df919243f7;hpb=214b3663d5d7598c13643f9221e43d5a7735b47f;p=ghc-hetmet.git diff --git a/rts/sm/BlockAlloc.c b/rts/sm/BlockAlloc.c index edc3762..484c0d4 100644 --- a/rts/sm/BlockAlloc.c +++ b/rts/sm/BlockAlloc.c @@ -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);