diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-07-20 12:24:56 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-07-20 12:24:56 +0000 |
commit | 0c750e8a43af3e68d000ba9009dce8dc8a2d9769 (patch) | |
tree | f2fe2696e3c73f492e489a108a52961b0ada7f73 /src/common/malloc.h | |
parent | 49aeb514a6fe9d96cb8478163b066d3ba5d269a9 (diff) | |
download | hercules-0c750e8a43af3e68d000ba9009dce8dc8a2d9769.tar.gz hercules-0c750e8a43af3e68d000ba9009dce8dc8a2d9769.tar.bz2 hercules-0c750e8a43af3e68d000ba9009dce8dc8a2d9769.tar.xz hercules-0c750e8a43af3e68d000ba9009dce8dc8a2d9769.zip |
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
Diffstat (limited to 'src/common/malloc.h')
-rw-r--r-- | src/common/malloc.h | 14 |
1 files changed, 5 insertions, 9 deletions
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)) //////////////////////////////////////////////// |