diff options
author | Ömer Sinan Ağacan <omer@well-typed.com> | 2018-03-05 15:57:47 +0300 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2019-10-18 15:27:56 -0400 |
commit | 921e4e360a1244ee63241efc62da28642343fece (patch) | |
tree | 456292c188343645c56c882d393965fe201b273a /includes | |
parent | c4c9904b324736dc5d190a91418e8d8f564d4104 (diff) | |
download | haskell-921e4e360a1244ee63241efc62da28642343fece.tar.gz |
rts/BlockAlloc: Allow aligned allocation requestswip/gc/aligned-block-allocation
This implements support for block group allocations which are aligned to
an integral number of blocks.
This will be used by the nonmoving garbage collector, which uses the
block allocator to allocate the segments which back its heap. These
segments are a fixed number of blocks in size, with each segment being
aligned to the segment size boundary. This allows us to easily find the
segment metadata stored at the beginning of the segment.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/rts/storage/Block.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/includes/rts/storage/Block.h b/includes/rts/storage/Block.h index ecd6bf5dd8..792a72d717 100644 --- a/includes/rts/storage/Block.h +++ b/includes/rts/storage/Block.h @@ -290,6 +290,13 @@ EXTERN_INLINE bdescr* allocBlock(void) bdescr *allocGroupOnNode(uint32_t node, W_ n); +// Allocate n blocks, aligned at n-block boundary. The returned bdescr will +// have this invariant +// +// bdescr->start % BLOCK_SIZE*n == 0 +// +bdescr *allocAlignedGroupOnNode(uint32_t node, W_ n); + EXTERN_INLINE bdescr* allocBlockOnNode(uint32_t node); EXTERN_INLINE bdescr* allocBlockOnNode(uint32_t node) { |