mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Use MAP_POPULATE only on Linux.
This commit is contained in:
parent
592b132b1a
commit
e3a9863260
@ -178,8 +178,13 @@ protected:
|
||||
// hash tables, it makes sense to pre-fault the pages by passing
|
||||
// MAP_POPULATE to mmap(). This takes some time, but should be faster
|
||||
// overall than having a hot loop interrupted by page faults.
|
||||
// It is only supported on Linux.
|
||||
#if defined(__linux__)
|
||||
static constexpr int mmap_flags = MAP_PRIVATE | MAP_ANONYMOUS
|
||||
| (mmap_populate ? MAP_POPULATE : 0);
|
||||
#else
|
||||
static constexpr int mmap_flags = MAP_PRIVATE | MAP_ANONYMOUS;
|
||||
#endif
|
||||
|
||||
private:
|
||||
void * allocNoTrack(size_t size, size_t alignment)
|
||||
|
Loading…
Reference in New Issue
Block a user