diff options
author | shennetsind <ind@henn.et> | 2013-11-19 02:20:07 -0200 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-11-19 02:20:07 -0200 |
commit | 242bc9fc39c90364dcf5f1a73a6d759efeef0ffd (patch) | |
tree | 0ac9e1e42c5db47d46f5a2d9e9d665b20fb46f63 /src/common/malloc.h | |
parent | d076f129c90ac9e3a96659488f702f81def1863a (diff) | |
parent | cb85f27f1ee334982fc3f9dfc1ffe824a1f8905c (diff) | |
download | hercules-242bc9fc39c90364dcf5f1a73a6d759efeef0ffd.tar.gz hercules-242bc9fc39c90364dcf5f1a73a6d759efeef0ffd.tar.bz2 hercules-242bc9fc39c90364dcf5f1a73a6d759efeef0ffd.tar.xz hercules-242bc9fc39c90364dcf5f1a73a6d759efeef0ffd.zip |
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Diffstat (limited to 'src/common/malloc.h')
-rw-r--r-- | src/common/malloc.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/common/malloc.h b/src/common/malloc.h index bc8aa9a20..cd0ef238b 100644 --- a/src/common/malloc.h +++ b/src/common/malloc.h @@ -30,11 +30,11 @@ #undef LOG_MEMMGR #endif -# define aMalloc(n) iMalloc->malloc (n,ALC_MARK) -# define aCalloc(m,n) iMalloc->calloc (m,n,ALC_MARK) -# define aRealloc(p,n) iMalloc->realloc (p,n,ALC_MARK) -# define aStrdup(p) iMalloc->astrdup (p,ALC_MARK) -# define aFree(p) iMalloc->free (p,ALC_MARK) +# define aMalloc(n) (iMalloc->malloc((n),ALC_MARK)) +# define aCalloc(m,n) (iMalloc->calloc((m),(n),ALC_MARK)) +# define aRealloc(p,n) (iMalloc->realloc((p),(n),ALC_MARK)) +# define aStrdup(p) (iMalloc->astrdup((p),ALC_MARK)) +# define aFree(p) (iMalloc->free((p),ALC_MARK)) /////////////// Buffer Creation ///////////////// // Full credit for this goes to Shinomori [Ajarn] @@ -46,15 +46,15 @@ #else // others don't, so we emulate them -#define CREATE_BUFFER(name, type, size) type *name = (type *) aCalloc (size, sizeof(type)) +#define CREATE_BUFFER(name, type, size) type *name = (type *) aCalloc((size), sizeof(type)) #define DELETE_BUFFER(name) aFree(name) #endif ////////////// Others ////////////////////////// // should be merged with any of above later -#define CREATE(result, type, number) (result) = (type *) aCalloc ((number), sizeof(type)) -#define RECREATE(result, type, number) (result) = (type *) aRealloc ((result), sizeof(type) * (number)) +#define CREATE(result, type, number) ((result) = (type *) aCalloc((number), sizeof(type))) +#define RECREATE(result, type, number) ((result) = (type *) aRealloc((result), sizeof(type) * (number))) //////////////////////////////////////////////// |