diff options
author | unknown <kaa@polly.local> | 2007-08-29 19:20:18 +0400 |
---|---|---|
committer | unknown <kaa@polly.local> | 2007-08-29 19:20:18 +0400 |
commit | ac275fd5fa2e91aade8fdf0aff50c13a9a33fa94 (patch) | |
tree | 8fdbff9cd25f03569de73e50c3c9fa015b6519c9 /mysys/my_malloc.c | |
parent | 4dac538a0b73ebbc2aa65f7bcd7327a4e15e0feb (diff) | |
download | mariadb-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_malloc.c')
-rw-r--r-- | mysys/my_malloc.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/mysys/my_malloc.c b/mysys/my_malloc.c index 38d0263b495..256b14a9605 100644 --- a/mysys/my_malloc.c +++ b/mysys/my_malloc.c @@ -23,11 +23,11 @@ /* My memory allocator */ -gptr my_malloc(unsigned int size, myf my_flags) +gptr my_malloc(size_t size, myf my_flags) { gptr point; DBUG_ENTER("my_malloc"); - DBUG_PRINT("my",("size: %u my_flags: %d",size, my_flags)); + DBUG_PRINT("my",("size: %lu my_flags: %d", (ulong) size, my_flags)); if (!size) size=1; /* Safety */ @@ -63,11 +63,11 @@ void my_no_flags_free(gptr ptr) /* malloc and copy */ -gptr my_memdup(const byte *from, uint length, myf my_flags) +gptr my_memdup(const byte *from, size_t length, myf my_flags) { gptr ptr; if ((ptr=my_malloc(length,my_flags)) != 0) - memcpy((byte*) ptr, (byte*) from,(size_t) length); + memcpy((byte*) ptr, (byte*)from, length); return(ptr); } @@ -75,19 +75,19 @@ gptr my_memdup(const byte *from, uint length, myf my_flags) char *my_strdup(const char *from, myf my_flags) { gptr ptr; - uint length=(uint) strlen(from)+1; + size_t length= strlen(from)+1; if ((ptr=my_malloc(length,my_flags)) != 0) - memcpy((byte*) ptr, (byte*) from,(size_t) length); + memcpy((byte*) ptr, (byte*) from, length); return((my_string) ptr); } -char *my_strdup_with_length(const char *from, uint length, myf my_flags) +char *my_strdup_with_length(const char *from, size_t length, myf my_flags) { gptr ptr; if ((ptr=my_malloc(length+1,my_flags)) != 0) { - memcpy((byte*) ptr, (byte*) from,(size_t) length); + memcpy((byte*) ptr, (byte*) from, length); ((char*) ptr)[length]=0; } return((char*) ptr); |