Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
40a76c99
Commit
40a76c99
authored
May 11, 2018
by
Ömer Sinan Ağacan
Browse files
BlockAlloc.c: reuse tail_of function
parent
87e169a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
rts/sm/BlockAlloc.c
View file @
40a76c99
...
...
@@ -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.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment