Fix gc memory leak
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <assert.h>
|
||||
#include <atomic>
|
||||
#include <cstdint>
|
||||
#include <inttypes.h>
|
||||
#include <optional>
|
||||
#include <stdio.h>
|
||||
@@ -338,6 +339,20 @@ struct MemManager {
|
||||
}
|
||||
next = max + 1;
|
||||
|
||||
for (int i = next; i < firstUnaddressable; ++i) {
|
||||
if (base[i].entry != nullptr) {
|
||||
#if DEBUG_VERBOSE
|
||||
if (debugVerboseEnabled) {
|
||||
printf(
|
||||
"Collecting %u while collecting right page-unaligned surplus\n",
|
||||
i);
|
||||
}
|
||||
#endif
|
||||
base[i].entry->delref();
|
||||
base[i].entry = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// Rebuild free list and delref entries
|
||||
freeList = 0;
|
||||
reachable.iterateAbsentApproxBackwards(
|
||||
|
Reference in New Issue
Block a user