Attempt to fix memory leak

This commit is contained in:
2024-07-03 09:48:02 -07:00
parent 88bcc7b75c
commit cc716ef16b
+10 -1
View File
@@ -606,6 +606,14 @@ template <class T> struct BoundedFreeListAllocator {
VALGRIND_MAKE_MEM_NOACCESS(freeList, sizeof(T) + p->partialKeyCapacity);
}
BoundedFreeListAllocator() = default;
BoundedFreeListAllocator(const BoundedFreeListAllocator &) = delete;
BoundedFreeListAllocator &
operator=(const BoundedFreeListAllocator &) = delete;
BoundedFreeListAllocator(BoundedFreeListAllocator &&) = delete;
BoundedFreeListAllocator &operator=(BoundedFreeListAllocator &&) = delete;
~BoundedFreeListAllocator() {
for (void *iter = freeList; iter != nullptr;) {
VALGRIND_MAKE_MEM_DEFINED(iter, sizeof(Node));
@@ -2994,7 +3002,8 @@ struct __attribute__((visibility("hidden"))) ConflictSet::Impl {
oldestVersionFullPrecision = oldestExtantVersion = oldestVersionAtGcBegin =
newestVersionFullPrecision = oldestVersion;
allocators = {};
allocators.~NodeAllocators();
new (&allocators) NodeAllocators();
removalKeyArena = Arena{};
removalKey = {};