mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-14 19:45:11 +00:00
fix fork hang
This commit is contained in:
parent
0f7defb87f
commit
d9aab84701
@ -1,34 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <base/defines.h>
|
||||
|
||||
#if USE_GWP_ASAN
|
||||
#include <gwp_asan/guarded_pool_allocator.h>
|
||||
#include <gwp_asan/optional/options_parser.h>
|
||||
#endif
|
||||
|
||||
namespace Memory
|
||||
{
|
||||
|
||||
#if USE_GWP_ASAN
|
||||
static gwp_asan::GuardedPoolAllocator GuardedAlloc;
|
||||
|
||||
static struct InitGwpAsan
|
||||
{
|
||||
InitGwpAsan()
|
||||
{
|
||||
gwp_asan::options::initOptions();
|
||||
gwp_asan::options::Options &opts = gwp_asan::options::getOptions();
|
||||
GuardedAlloc.init(opts);
|
||||
}
|
||||
|
||||
static bool isInit()
|
||||
{
|
||||
return GuardedAlloc.getAllocatorState()->GuardedPagePoolEnd != 0;
|
||||
}
|
||||
} init_gwp_asan;
|
||||
#endif
|
||||
|
||||
}
|
@ -18,6 +18,10 @@
|
||||
# include <cstdlib>
|
||||
#endif
|
||||
|
||||
#if USE_GWP_ASAN
|
||||
static gwp_asan::GuardedPoolAllocator GuardedAlloc;
|
||||
#endif
|
||||
|
||||
namespace Memory
|
||||
{
|
||||
|
||||
|
@ -23,6 +23,25 @@ extern "C"
|
||||
extern void zone_register();
|
||||
}
|
||||
|
||||
#if USE_GWP_ASAN
|
||||
/// Both clickhouse_new_delete and clickhouse_common_io links gwp_asan, but It should only init once, otherwise it
|
||||
/// will cause unexpected deadlock.
|
||||
static struct InitGwpAsan
|
||||
{
|
||||
InitGwpAsan()
|
||||
{
|
||||
gwp_asan::options::initOptions();
|
||||
gwp_asan::options::Options &opts = gwp_asan::options::getOptions();
|
||||
GuardedAlloc.init(opts);
|
||||
}
|
||||
|
||||
static bool isInit()
|
||||
{
|
||||
return GuardedAlloc.getAllocatorState()->GuardedPagePoolEnd != 0;
|
||||
}
|
||||
} init_gwp_asan;
|
||||
#endif
|
||||
|
||||
static struct InitializeJemallocZoneAllocatorForOSX
|
||||
{
|
||||
InitializeJemallocZoneAllocatorForOSX()
|
||||
|
Loading…
Reference in New Issue
Block a user