summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <kaa@polly.local>2004-12-20 20:20:20 +0300
committerunknown <kaa@polly.local>2004-12-20 20:20:20 +0300
commitde5ce11108f636dfc2d61eaaa77cc3604e767383 (patch)
treecd4ae2c3322ecb7da5b0a5aba5ed7834baf9bb0e
parentfb69c85183fa51a3a7ed95297c2b9f8a98ba6b48 (diff)
parent19ee81dfb989c39ff25259412703162988f4d291 (diff)
downloadmariadb-git-de5ce11108f636dfc2d61eaaa77cc3604e767383.tar.gz
Merge akopytov@bk-internal.mysql.com:/home/bk/mysql-5.0
into polly.local:/home/kaa/src/mysql-5.0 innobase/os/os0proc.c: Auto merged
-rw-r--r--innobase/os/os0proc.c14
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