From 0c750e8a43af3e68d000ba9009dce8dc8a2d9769 Mon Sep 17 00:00:00 2001 From: ultramage Date: Wed, 20 Jul 2011 12:24:56 +0000 Subject: Removed malloc's Atomic (-A) function macros (see r968, changelog 01/20). They were specific to the GC allocator (atomic = promise to not have any pointers to other things inside = will be skipped during Mark phase), serving as a (dubious) optimization trick - which could cause GC to malfunction if used incorrectly. Simplified GC's CALLOC, since the GC docs say GC_MALLOC automatically clears memory. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14916 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/common/malloc.h | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/common/malloc.h') diff --git a/src/common/malloc.h b/src/common/malloc.h index 4e0c603b4..e565b4eb0 100644 --- a/src/common/malloc.h +++ b/src/common/malloc.h @@ -41,9 +41,7 @@ #endif # define aMalloc(n) _mmalloc(n,ALC_MARK) -# define aMallocA(n) _mmalloc(n,ALC_MARK) # define aCalloc(m,n) _mcalloc(m,n,ALC_MARK) -# define aCallocA(m,n) _mcalloc(m,n,ALC_MARK) # define aRealloc(p,n) _mrealloc(p,n,ALC_MARK) # define aStrdup(p) _mstrdup(p,ALC_MARK) # define aFree(p) _mfree(p,ALC_MARK) @@ -57,23 +55,24 @@ #else # define aMalloc(n) aMalloc_((n),ALC_MARK) -# define aMallocA(n) aMallocA_((n),ALC_MARK) # define aCalloc(m,n) aCalloc_((m),(n),ALC_MARK) -# define aCallocA(m,n) aCallocA_(m,n,ALC_MARK) # define aRealloc(p,n) aRealloc_(p,n,ALC_MARK) # define aStrdup(p) aStrdup_(p,ALC_MARK) # define aFree(p) aFree_(p,ALC_MARK) void* aMalloc_ (size_t size, const char *file, int line, const char *func); - void* aMallocA_ (size_t size, const char *file, int line, const char *func); void* aCalloc_ (size_t num, size_t size, const char *file, int line, const char *func); - void* aCallocA_ (size_t num, size_t size, const char *file, int line, const char *func); void* aRealloc_ (void *p, size_t size, const char *file, int line, const char *func); char* aStrdup_ (const char *p, const char *file, int line, const char *func); void aFree_ (void *p, const char *file, int line, const char *func); #endif +// deprecated, do not use +#define aMallocA aMalloc +#define aCallocA aCalloc +#define CREATE_A CREATE + /////////////// Buffer Creation ///////////////// // Full credit for this goes to Shinomori [Ajarn] @@ -92,9 +91,6 @@ ////////////// Others ////////////////////////// // should be merged with any of above later #define CREATE(result, type, number) (result) = (type *) aCalloc ((number), sizeof(type)) - -#define CREATE_A(result, type, number) (result) = (type *) aCallocA ((number), sizeof(type)) - #define RECREATE(result, type, number) (result) = (type *) aRealloc ((result), sizeof(type) * (number)) //////////////////////////////////////////////// -- cgit v1.2.3-70-g09d2