mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-23 10:10:50 +00:00
Merge pull request #11830 from zlobober/fix_mmap_threshold
Move MMAP_THRESHOLD definition to .cpp file.
This commit is contained in:
commit
e6ab9b969e
19
src/Common/Allocator.cpp
Normal file
19
src/Common/Allocator.cpp
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#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.
|
||||||
|
*
|
||||||
|
* Note: extern may seem redundant, but is actually needed due to bug in GCC.
|
||||||
|
* See also: https://gcc.gnu.org/legacy-ml/gcc-help/2017-12/msg00021.html
|
||||||
|
*/
|
||||||
|
#ifdef NDEBUG
|
||||||
|
__attribute__((__weak__)) extern 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.
|
||||||
|
*/
|
||||||
|
__attribute__((__weak__)) extern const size_t MMAP_THRESHOLD = 4096;
|
||||||
|
#endif
|
@ -57,16 +57,7 @@
|
|||||||
* third-party applications which may already use own allocator doing mmaps
|
* third-party applications which may already use own allocator doing mmaps
|
||||||
* in the implementation of alloc/realloc.
|
* in the implementation of alloc/realloc.
|
||||||
*/
|
*/
|
||||||
#ifdef NDEBUG
|
extern const size_t MMAP_THRESHOLD;
|
||||||
__attribute__((__weak__)) extern 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.
|
|
||||||
*/
|
|
||||||
__attribute__((__weak__)) extern const size_t MMAP_THRESHOLD = 4096;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static constexpr size_t MMAP_MIN_ALIGNMENT = 4096;
|
static constexpr size_t MMAP_MIN_ALIGNMENT = 4096;
|
||||||
static constexpr size_t MALLOC_MIN_ALIGNMENT = 8;
|
static constexpr size_t MALLOC_MIN_ALIGNMENT = 8;
|
||||||
|
@ -23,6 +23,7 @@ INCLUDE(${ARCADIA_ROOT}/clickhouse/cmake/yandex/ya.make.versions.inc)
|
|||||||
SRCS(
|
SRCS(
|
||||||
ActionLock.cpp
|
ActionLock.cpp
|
||||||
AlignedBuffer.cpp
|
AlignedBuffer.cpp
|
||||||
|
Allocator.cpp
|
||||||
checkStackSize.cpp
|
checkStackSize.cpp
|
||||||
ClickHouseRevision.cpp
|
ClickHouseRevision.cpp
|
||||||
Config/AbstractConfigurationComparison.cpp
|
Config/AbstractConfigurationComparison.cpp
|
||||||
|
Loading…
Reference in New Issue
Block a user