forked from weaselab/conflict-set
Attempt to fix memory leak
This commit is contained in:
+10
-1
@@ -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 = {};
|
||||
|
||||
Reference in New Issue
Block a user