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);
|
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() {
|
~BoundedFreeListAllocator() {
|
||||||
for (void *iter = freeList; iter != nullptr;) {
|
for (void *iter = freeList; iter != nullptr;) {
|
||||||
VALGRIND_MAKE_MEM_DEFINED(iter, sizeof(Node));
|
VALGRIND_MAKE_MEM_DEFINED(iter, sizeof(Node));
|
||||||
@@ -2994,7 +3002,8 @@ struct __attribute__((visibility("hidden"))) ConflictSet::Impl {
|
|||||||
oldestVersionFullPrecision = oldestExtantVersion = oldestVersionAtGcBegin =
|
oldestVersionFullPrecision = oldestExtantVersion = oldestVersionAtGcBegin =
|
||||||
newestVersionFullPrecision = oldestVersion;
|
newestVersionFullPrecision = oldestVersion;
|
||||||
|
|
||||||
allocators = {};
|
allocators.~NodeAllocators();
|
||||||
|
new (&allocators) NodeAllocators();
|
||||||
|
|
||||||
removalKeyArena = Arena{};
|
removalKeyArena = Arena{};
|
||||||
removalKey = {};
|
removalKey = {};
|
||||||
|
|||||||
Reference in New Issue
Block a user