From 9359223e694f28c1aa30717694a243d8fb057f07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Wed, 10 Jun 2015 13:04:19 +0200 Subject: [PATCH] Remove memory leak detector. Is it not thread-safe. --- libevmjit/Array.cpp | 43 ++----------------------------------------- 1 file changed, 2 insertions(+), 41 deletions(-) diff --git a/libevmjit/Array.cpp b/libevmjit/Array.cpp index 3266038db..0b511a058 100644 --- a/libevmjit/Array.cpp +++ b/libevmjit/Array.cpp @@ -9,8 +9,6 @@ #include "Runtime.h" #include "Utils.h" -#include // DEBUG only - namespace dev { namespace eth @@ -269,52 +267,15 @@ void Array::extend(llvm::Value* _arrayPtr, llvm::Value* _size) } } -namespace -{ - struct AllocatedMemoryWatchdog - { - std::set allocatedMemory; - - ~AllocatedMemoryWatchdog() - { - if (!allocatedMemory.empty()) - { - DLOG(mem) << allocatedMemory.size() << " MEM LEAKS!\n"; - for (auto&& leak : allocatedMemory) - DLOG(mem) << "\t" << leak << "\n"; - } - } - }; - - AllocatedMemoryWatchdog watchdog; -} - extern "C" { - using namespace dev::eth::jit; - EXPORT void* ext_realloc(void* _data, size_t _size) noexcept { - //std::cerr << "REALLOC: " << _data << " [" << _size << "]" << std::endl; - auto newData = std::realloc(_data, _size); - if (_data != newData) - { - DLOG(mem) << "REALLOC: " << newData << " <- " << _data << " [" << _size << "]\n"; - watchdog.allocatedMemory.erase(_data); - watchdog.allocatedMemory.insert(newData); - } - return newData; + return std::realloc(_data, _size); } EXPORT void ext_free(void* _data) noexcept { std::free(_data); - if (_data) - { - DLOG(mem) << "FREE : " << _data << "\n"; - watchdog.allocatedMemory.erase(_data); - } } - -} // extern "C" - +}