mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Merge pull request #29820 from azat/MINSIGSTKSZ-fix
Fix compilation with glibc 2.34 (MINSIGSTKSZ defined as sysconf(_SC_SIGSTKSZ))
This commit is contained in:
commit
a651c1bb67
@ -44,7 +44,7 @@ namespace
|
||||
struct ThreadStack
|
||||
{
|
||||
ThreadStack()
|
||||
: data(aligned_alloc(getPageSize(), size))
|
||||
: data(aligned_alloc(getPageSize(), getSize()))
|
||||
{
|
||||
/// Add a guard page
|
||||
/// (and since the stack grows downward, we need to protect the first page).
|
||||
@ -56,12 +56,11 @@ struct ThreadStack
|
||||
free(data);
|
||||
}
|
||||
|
||||
static size_t getSize() { return size; }
|
||||
static size_t getSize() { return std::max<size_t>(16 << 10, MINSIGSTKSZ); }
|
||||
void * getData() const { return data; }
|
||||
|
||||
private:
|
||||
/// 16 KiB - not too big but enough to handle error.
|
||||
static constexpr size_t size = std::max<size_t>(16 << 10, MINSIGSTKSZ);
|
||||
void * data;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user