diff options
author | Ben Gamari <ben@smart-cactus.org> | 2019-05-11 19:53:46 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2019-10-22 12:18:39 -0400 |
commit | e893877e3964cd8c8b147c14b3a2b38410e7427b (patch) | |
tree | 24f82da3bf99194d8c715a11cdff16ae18ca9adc /rts/sm/NonMovingSweep.c | |
parent | 0387df5bfd166f82ee11d4ce7d96eb52bf1ba9f7 (diff) | |
download | haskell-e893877e3964cd8c8b147c14b3a2b38410e7427b.tar.gz |
NonMoving: Fuse sweep preparation into mark prep
Diffstat (limited to 'rts/sm/NonMovingSweep.c')
-rw-r--r-- | rts/sm/NonMovingSweep.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/rts/sm/NonMovingSweep.c b/rts/sm/NonMovingSweep.c index b67bba0ce5..0236ef82e9 100644 --- a/rts/sm/NonMovingSweep.c +++ b/rts/sm/NonMovingSweep.c @@ -17,38 +17,6 @@ #include "Trace.h" #include "StableName.h" -static struct NonmovingSegment *pop_all_filled_segments(struct NonmovingAllocator *alloc) -{ - while (true) { - struct NonmovingSegment *head = alloc->filled; - if (cas((StgVolatilePtr) &alloc->filled, (StgWord) head, (StgWord) NULL) == (StgWord) head) - return head; - } -} - -void nonmovingPrepareSweep() -{ - ASSERT(nonmovingHeap.sweep_list == NULL); - - // Move blocks in the allocators' filled lists into sweep_list - for (unsigned int alloc_idx = 0; alloc_idx < NONMOVING_ALLOCA_CNT; alloc_idx++) - { - struct NonmovingAllocator *alloc = nonmovingHeap.allocators[alloc_idx]; - struct NonmovingSegment *filled = pop_all_filled_segments(alloc); - - // Link filled to sweep_list - if (filled) { - struct NonmovingSegment *filled_head = filled; - // Find end of filled list - while (filled->link) { - filled = filled->link; - } - filled->link = nonmovingHeap.sweep_list; - nonmovingHeap.sweep_list = filled_head; - } - } -} - // On which list should a particular segment be placed? enum SweepResult { SEGMENT_FREE, // segment is empty: place on free list |