summaryrefslogtreecommitdiff
path: root/rts/sm
diff options
context:
space:
mode:
authorÖmer Sinan Ağacan <omeragacan@gmail.com>2018-05-11 10:24:00 +0300
committerÖmer Sinan Ağacan <omeragacan@gmail.com>2018-05-11 10:24:00 +0300
commit40a76c99624ae82e960bad0f1c832ddec4aece16 (patch)
treec09a8a987b5b764880a8c6c15bd6e0f4d9312c7f /rts/sm
parent87e169a30dae11444a90b4d37c3d30e57b9c275b (diff)
downloadhaskell-40a76c99624ae82e960bad0f1c832ddec4aece16.tar.gz
BlockAlloc.c: reuse tail_of function
Diffstat (limited to 'rts/sm')
-rw-r--r--rts/sm/BlockAlloc.c15
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.