diff options
author | unknown <kaa@polly.local> | 2004-12-20 20:17:36 +0300 |
---|---|---|
committer | unknown <kaa@polly.local> | 2004-12-20 20:17:36 +0300 |
commit | 19ee81dfb989c39ff25259412703162988f4d291 (patch) | |
tree | 52466e99f4ded9d2c3e6bc0e9aa23d7c70661e60 /innobase/os | |
parent | 699f55e70cc957187347c77ead8c7fe280675dab (diff) | |
download | mariadb-git-19ee81dfb989c39ff25259412703162988f4d291.tar.gz |
Fixed compilation for old Linux distributions that have no HugeTLB support
Diffstat (limited to 'innobase/os')
-rw-r--r-- | innobase/os/os0proc.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/innobase/os/os0proc.c b/innobase/os/os0proc.c index dd2037695b7..167aed93de7 100644 --- a/innobase/os/os0proc.c +++ b/innobase/os/os0proc.c @@ -532,7 +532,7 @@ os_mem_alloc_large( ibool assert_on_error) /* in: if TRUE, we crash mysqld if the memory cannot be allocated */ { -#ifdef UNIV_LINUX +#ifdef HAVE_LARGE_PAGES ulint size; int shmid; void *ptr = NULL; @@ -541,7 +541,8 @@ os_mem_alloc_large( if (!os_use_large_pages || !os_large_page_size) { goto skip; } - + +#ifdef UNIV_LINUX /* Align block size to os_large_page_size */ size = ((n - 1) & ~(os_large_page_size - 1)) + os_large_page_size; @@ -561,6 +562,7 @@ os_mem_alloc_large( */ shmctl(shmid, IPC_RMID, &buf); } +#endif if (ptr) { if (set_to_zero) { @@ -573,8 +575,8 @@ os_mem_alloc_large( } fprintf(stderr, "InnoDB HugeTLB: Warning: Using conventional memory pool\n"); -#endif skip: +#endif /* HAVE_LARGE_PAGES */ return(ut_malloc_low(n, set_to_zero, assert_on_error)); } @@ -587,8 +589,12 @@ os_mem_free_large( /*=================*/ void *ptr) /* in: number of bytes */ { +#ifdef HAVE_LARGE_PAGES + if (os_use_large_pages && os_large_page_size #ifdef UNIV_LINUX - if (os_use_large_pages && os_large_page_size && !shmdt(ptr)) { + && !shmdt(ptr) +#endif + ) { return; } #endif |