mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
MDEV-24125: allow compile on Linux headers < 3.8
This allows MariaDB to compile on old (limits to >2.6.32) linux kernel versions. This warns that attempts to use large pages will rely on implict kernel determination.
This commit is contained in:
parent
8cc5d2845c
commit
7f30a5c423
1 changed files with 7 additions and 3 deletions
|
@ -325,9 +325,13 @@ uchar *my_large_malloc(size_t *size, myf my_flags)
|
|||
/* this might be 0, in which case we do a standard mmap */
|
||||
if (large_page_size)
|
||||
{
|
||||
#ifdef __linux__
|
||||
mapflag|= MAP_HUGETLB |
|
||||
my_bit_log2_size_t(large_page_size) << MAP_HUGE_SHIFT;
|
||||
#if defined(MAP_HUGETLB) /* linux 2.6.32 */
|
||||
mapflag|= MAP_HUGETLB;
|
||||
#if defined(MAP_HUGE_SHIFT) /* Linux-3.8+ */
|
||||
mapflag|= my_bit_log2_size_t(large_page_size) << MAP_HUGE_SHIFT;
|
||||
#else
|
||||
# warning "No explicit large page (HUGETLB pages) support in Linux < 3.8"
|
||||
#endif
|
||||
#elif defined(MAP_ALIGNED)
|
||||
mapflag|= MAP_ALIGNED_SUPER |
|
||||
MAP_ALIGNED(my_bit_log2_size_t(large_page_size));
|
||||
|
|
Loading…
Reference in a new issue