Skip to content
Snippets Groups Projects
Commit a3f4198f authored by Jonas Rembser's avatar Jonas Rembser
Browse files

[RF] Deallocate memory owned by empty MemPoolForRooSets Arenas

If an arena in the MemPoolForRooSets is not referenced anymore, it
should delete the memory it has allocated.
parent 47facd6d
No related branches found
No related tags found
No related merge requests found
...@@ -126,6 +126,7 @@ class MemPoolForRooSets { ...@@ -126,6 +126,7 @@ class MemPoolForRooSets {
{ {
if (inPool(ptr)) { if (inPool(ptr)) {
--refCount; --refCount;
tryFree(false);
#ifndef NDEBUG #ifndef NDEBUG
const std::size_t index = static_cast<RooSet_t *>(ptr) - memBegin; const std::size_t index = static_cast<RooSet_t *>(ptr) - memBegin;
if (deletedElements.count(index) != 0) { if (deletedElements.count(index) != 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment