From 9490594167439937cc669c7215ee4f07d67cc7c7 Mon Sep 17 00:00:00 2001 From: Daniel Krebs Date: Tue, 15 May 2018 12:00:31 +0200 Subject: [PATCH] allocator: properly remove memory block from memory graph --- fpga/include/villas/memory.hpp | 2 ++ fpga/lib/common/memory.cpp | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/fpga/include/villas/memory.hpp b/fpga/include/villas/memory.hpp index 8a1895b23..12779bf01 100644 --- a/fpga/include/villas/memory.hpp +++ b/fpga/include/villas/memory.hpp @@ -116,6 +116,8 @@ public: free = [&](MemoryBlock* mem) { logger->warn("no free callback defined for addr space {}, not freeing", mem->getAddrSpaceId()); + + removeMemoryBlock(*mem); }; } diff --git a/fpga/lib/common/memory.cpp b/fpga/lib/common/memory.cpp index f2def1432..c6d5b386e 100644 --- a/fpga/lib/common/memory.cpp +++ b/fpga/lib/common/memory.cpp @@ -62,6 +62,8 @@ LinearAllocator::LinearAllocator(MemoryManager::AddressSpaceId memoryAddrSpaceId mem->getSize(), mem->getOffset(), mem->getAddrSpaceId()); logger->warn("free() not implemented"); logger->debug("available memory: {:#x} bytes", getAvailableMemory()); + + removeMemoryBlock(*mem); }; } @@ -133,6 +135,8 @@ HostRam::HostRamAllocator::HostRamAllocator() : logger->warn("munmap() failed for {:#x} of size {:#x}", mem->getOffset(), mem->getSize()); } + + removeMemoryBlock(*mem); }; }