diff options
author | (no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-01-23 20:38:44 +0000 |
---|---|---|
committer | (no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-01-23 20:38:44 +0000 |
commit | 2c5fabbc0b492cb5456e670ce9eb2352a11d5e3b (patch) | |
tree | 89c47d81729687d5a69cadde99ee350306eb814f /src/common/malloc.c | |
parent | c4e6857d4774b25dcd9b9137f76c14c92015d691 (diff) | |
download | hercules-2c5fabbc0b492cb5456e670ce9eb2352a11d5e3b.tar.gz hercules-2c5fabbc0b492cb5456e670ce9eb2352a11d5e3b.tar.bz2 hercules-2c5fabbc0b492cb5456e670ce9eb2352a11d5e3b.tar.xz hercules-2c5fabbc0b492cb5456e670ce9eb2352a11d5e3b.zip |
update
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@968 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/malloc.c')
-rw-r--r-- | src/common/malloc.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/common/malloc.c b/src/common/malloc.c index ed5fb2e44..a00399a0e 100644 --- a/src/common/malloc.c +++ b/src/common/malloc.c @@ -1,9 +1,10 @@ -#if !defined(DMALLOC) && !defined(GCOLLECT) && !defined(BCHECK) #include <stdio.h> #include <stdlib.h> #include <string.h> #include "malloc.h" +#if !defined(DMALLOC) && !defined(GCOLLECT) && !defined(BCHECK) + void* aMalloc_( size_t size, const char *file, int line, const char *func ) { void *ret; @@ -45,9 +46,27 @@ void* aRealloc_( void *p, size_t size, const char *file, int line, const char *f return ret; } +#endif + + +#if defined(GCOLLECT) + +void * _bcallocA(size_t size, size_t cnt) { + void *ret = aMallocA(size * cnt); + memset(ret, 0, size * cnt); + return ret; +} + void * _bcalloc(size_t size, size_t cnt) { - void *ret = malloc(size * cnt); + void *ret = aMalloc(size * cnt); memset(ret, 0, size * cnt); return ret; } #endif + +char * _bstrdup(const char *chr) { + int len = strlen(chr); + char *ret = aMalloc(len + 1); + strcpy(ret, chr); + return ret; +} |