diff options
author | Simon Marlow <marlowsd@gmail.com> | 2012-09-07 16:01:36 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2012-09-07 16:25:16 +0100 |
commit | bf2d58c2356578e87c1b09de0636a7cf57c71fe7 (patch) | |
tree | cc0e89e50c62010894a211fd20be019ebb4e23e9 /rts/sm/BlockAlloc.c | |
parent | 0550bcbf040bd15b4c99add47e3fbb7387be38ff (diff) | |
download | haskell-bf2d58c2356578e87c1b09de0636a7cf57c71fe7.tar.gz |
Lots of nat -> StgWord changes
Diffstat (limited to 'rts/sm/BlockAlloc.c')
-rw-r--r-- | rts/sm/BlockAlloc.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/rts/sm/BlockAlloc.c b/rts/sm/BlockAlloc.c index 113031a20b..f0f6fb551c 100644 --- a/rts/sm/BlockAlloc.c +++ b/rts/sm/BlockAlloc.c @@ -168,7 +168,7 @@ STATIC_INLINE void initGroup(bdescr *head) { bdescr *bd; - nat i, n; + W_ i, n; n = head->blocks; head->free = head->start; @@ -184,9 +184,9 @@ initGroup(bdescr *head) // usually small, and MAX_FREE_LIST is also small, so the loop version // might well be the best choice here. STATIC_INLINE nat -log_2_ceil(nat n) +log_2_ceil(W_ n) { - nat i, x; + W_ i, x; x = 1; for (i=0; i < MAX_FREE_LIST; i++) { if (x >= n) return i; @@ -196,9 +196,9 @@ log_2_ceil(nat n) } STATIC_INLINE nat -log_2(nat n) +log_2(W_ n) { - nat i, x; + W_ i, x; x = n; for (i=0; i < MAX_FREE_LIST; i++) { x = x >> 1; @@ -244,7 +244,7 @@ setup_tail (bdescr *bd) // Take a free block group bd, and split off a group of size n from // it. Adjust the free list as necessary, and return the new group. static bdescr * -split_free_block (bdescr *bd, nat n, nat ln) +split_free_block (bdescr *bd, W_ n, nat ln) { bdescr *fg; // free group @@ -311,7 +311,7 @@ alloc_mega_group (nat mblocks) } bdescr * -allocGroup (nat n) +allocGroup (W_ n) { bdescr *bd, *rem; nat ln; @@ -400,7 +400,7 @@ finish: // single compile. // bdescr * -allocLargeChunk (nat min, nat max) +allocLargeChunk (W_ min, W_ max) { bdescr *bd; nat ln, lnmax; @@ -441,7 +441,7 @@ allocLargeChunk (nat min, nat max) } bdescr * -allocGroup_lock(nat n) +allocGroup_lock(W_ n) { bdescr *bd; ACQUIRE_SM_LOCK; @@ -653,10 +653,10 @@ initMBlock(void *mblock) Stats / metrics -------------------------------------------------------------------------- */ -nat +W_ countBlocks(bdescr *bd) { - nat n; + W_ n; for (n=0; bd != NULL; bd=bd->link) { n += bd->blocks; } @@ -668,10 +668,10 @@ countBlocks(bdescr *bd) // that would be taken up by block descriptors in the second and // subsequent megablock. This is so we can tally the count with the // number of blocks allocated in the system, for memInventory(). -nat +W_ countAllocdBlocks(bdescr *bd) { - nat n; + W_ n; for (n=0; bd != NULL; bd=bd->link) { n += bd->blocks; // hack for megablock groups: see (*1) above @@ -806,7 +806,7 @@ checkFreeListSanity(void) } } -nat /* BLOCKS */ +W_ /* BLOCKS */ countFreeList(void) { bdescr *bd; |