diff options
Diffstat (limited to 'rts/sm/BlockAlloc.c')
-rw-r--r-- | rts/sm/BlockAlloc.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/rts/sm/BlockAlloc.c b/rts/sm/BlockAlloc.c index 2a02ecc9c5..bbb4f8a6c1 100644 --- a/rts/sm/BlockAlloc.c +++ b/rts/sm/BlockAlloc.c @@ -210,6 +210,12 @@ void recordFreedBlocks(uint32_t node, uint32_t n) Allocation -------------------------------------------------------------------------- */ +STATIC_INLINE bdescr * +tail_of (bdescr *bd) +{ + return bd + bd->blocks - 1; +} + STATIC_INLINE void initGroup(bdescr *head) { @@ -223,7 +229,7 @@ initGroup(bdescr *head) // mblocks don't have bdescrs; freeing these is handled in a // different way by free_mblock_group(). if (head->blocks > 1 && head->blocks <= BLOCKS_PER_MBLOCK) { - bdescr *last = head + head->blocks-1; + bdescr *last = tail_of(head); last->blocks = 0; last->link = head; } @@ -285,13 +291,6 @@ free_list_insert (uint32_t node, bdescr *bd) dbl_link_onto(bd, &free_list[node][ln]); } - -STATIC_INLINE bdescr * -tail_of (bdescr *bd) -{ - return bd + bd->blocks - 1; -} - // After splitting a group, the last block of each group must have a // tail that points to the head block, to keep our invariants for // coalescing. |