ClickHouse/src/Common/Allocator.cpp

17 lines
621 B
C++
Raw Normal View History

#include "Allocator.h"
/** Keep definition of this constant in cpp file; otherwise its value
* is inlined into allocator code making it impossible to override it
* in third-party code.
*/
#ifdef NDEBUG
2020-06-20 18:52:36 +00:00
__attribute__((__weak__)) const size_t MMAP_THRESHOLD = 64 * (1ULL << 20);
#else
/**
* In debug build, use small mmap threshold to reproduce more memory
* stomping bugs. Along with ASLR it will hopefully detect more issues than
* ASan. The program may fail due to the limit on number of memory mappings.
*/
2020-06-20 18:52:36 +00:00
__attribute__((__weak__)) const size_t MMAP_THRESHOLD = 4096;
#endif