Skip to content

Commit 636ea36

Browse files
Fixing munmap_arena_and_reset issue by reseting allocation_ptr (#1205)
The `allocation_ptr` was the missing variable we needed to reset to correctly reset the whole semispace GC strategy. This PR fixes issue #1204 where the `allocation_ptr` kept an old value from a previous GC iteration that was often higher than the current `oldspace` semispace, making it impossible to be allocated or to clean the memory using it on `scan_ptr`
1 parent d586539 commit 636ea36

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

include/runtime/arena.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ class arena {
122122

123123
current_addr_ptr = nullptr;
124124
collection_addr_ptr = nullptr;
125+
allocation_ptr = nullptr;
125126
tripwire = nullptr;
126127
}
127128

runtime/collect/collect.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ void free_all_kore_mem() {
347347
kore_collect(nullptr, 0, nullptr, true);
348348
kore_clear();
349349
youngspace.munmap_arena_and_reset();
350+
oldspace.munmap_arena_and_reset();
350351
alwaysgcspace.munmap_arena_and_reset();
351352
}
352353
}

0 commit comments

Comments
 (0)