mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-12 02:23:14 +00:00
Merge pull request #6450 from 4ertus2/some
Fix memory tracking under sanitizers
This commit is contained in:
commit
fbcb5f5d31
@ -1,3 +1,4 @@
|
||||
#include <malloc.h>
|
||||
#include <new>
|
||||
|
||||
#include <common/config_common.h>
|
||||
@ -49,6 +50,11 @@ ALWAYS_INLINE void untrackMemory(void * ptr [[maybe_unused]], std::size_t size [
|
||||
#else
|
||||
if (size)
|
||||
CurrentMemoryTracker::free(size);
|
||||
#ifdef _GNU_SOURCE
|
||||
/// It's innaccurate resource free for sanitizers. malloc_usable_size() result is greater or equal to allocated size.
|
||||
else
|
||||
CurrentMemoryTracker::free(malloc_usable_size(ptr));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
catch (...)
|
||||
|
Loading…
Reference in New Issue
Block a user