summaryrefslogtreecommitdiff
path: root/mysys/my_largepage.c
diff options
context:
space:
mode:
authorunknown <kaa@polly.local>2007-08-29 19:20:18 +0400
committerunknown <kaa@polly.local>2007-08-29 19:20:18 +0400
commitac275fd5fa2e91aade8fdf0aff50c13a9a33fa94 (patch)
tree8fdbff9cd25f03569de73e50c3c9fa015b6519c9 /mysys/my_largepage.c
parent4dac538a0b73ebbc2aa65f7bcd7327a4e15e0feb (diff)
downloadmariadb-git-ac275fd5fa2e91aade8fdf0aff50c13a9a33fa94.tar.gz
Backport of my_malloc() changes from 5.1 to make it 64-bit safe on Unix platforms.
This is required to allow key_buffer_size > 4 GB (bug #5731). include/my_sys.h: Backport of my_malloc() changes from 5.1 to make it 64-bit safe on Unix platforms. mysys/my_largepage.c: Backport of my_malloc() changes from 5.1 to make it 64-bit safe on Unix platforms. mysys/my_malloc.c: Backport of my_malloc() changes from 5.1 to make it 64-bit safe on Unix platforms. mysys/safemalloc.c: Backport of my_malloc() changes from 5.1 to make it 64-bit safe on Unix platforms.
Diffstat (limited to 'mysys/my_largepage.c')
-rw-r--r--mysys/my_largepage.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/mysys/my_largepage.c b/mysys/my_largepage.c
index 9714c582acb..082b6368a64 100644
--- a/mysys/my_largepage.c
+++ b/mysys/my_largepage.c
@@ -26,7 +26,7 @@
#endif
static uint my_get_large_page_size_int(void);
-static gptr my_large_malloc_int(uint size, myf my_flags);
+static gptr my_large_malloc_int(size_t size, myf my_flags);
static my_bool my_large_free_int(gptr ptr, myf my_flags);
/* Gets the size of large pages from the OS */
@@ -48,7 +48,7 @@ uint my_get_large_page_size(void)
my_malloc_lock() in case of failure
*/
-gptr my_large_malloc(uint size, myf my_flags)
+gptr my_large_malloc(size_t size, myf my_flags)
{
gptr ptr;
DBUG_ENTER("my_large_malloc");
@@ -113,7 +113,7 @@ finish:
#if HAVE_DECL_SHM_HUGETLB
/* Linux-specific large pages allocator */
-gptr my_large_malloc_int(uint size, myf my_flags)
+gptr my_large_malloc_int(size_t size, myf my_flags)
{
int shmid;
gptr ptr;
@@ -123,13 +123,13 @@ gptr my_large_malloc_int(uint size, myf my_flags)
/* Align block size to my_large_page_size */
size = ((size - 1) & ~(my_large_page_size - 1)) + my_large_page_size;
- shmid = shmget(IPC_PRIVATE, (size_t)size, SHM_HUGETLB | SHM_R | SHM_W);
+ shmid = shmget(IPC_PRIVATE, size, SHM_HUGETLB | SHM_R | SHM_W);
if (shmid < 0)
{
if (my_flags & MY_WME)
fprintf(stderr,
- "Warning: Failed to allocate %d bytes from HugeTLB memory."
- " errno %d\n", size, errno);
+ "Warning: Failed to allocate %lu bytesx from HugeTLB memory."
+ " errno %d\n", (ulong) size, errno);
DBUG_RETURN(NULL);
}