From 60a426c0742b3e7d8c5b557c7578df6eeeea377b Mon Sep 17 00:00:00 2001 From: brianluau Date: Wed, 5 Dec 2012 02:53:33 +0000 Subject: - Undid r16968: SVN Replaced with source:/trunk/src/@16966 (tid:74924). [16969:16991/trunk/src/] will be re-committed in the next 24 hours. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16992 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/common/malloc.h | 58 ++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'src/common/malloc.h') diff --git a/src/common/malloc.h b/src/common/malloc.h index 58dcee6d7..6b4e8e5c4 100644 --- a/src/common/malloc.h +++ b/src/common/malloc.h @@ -33,31 +33,31 @@ #undef LOG_MEMMGR #endif -# define aMalloc(n) _mmalloc(n,ALC_MARK) -# define aCalloc(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) - -void *_mmalloc(size_t size, const char *file, int line, const char *func); -void *_mcalloc(size_t num, size_t size, const char *file, int line, const char *func); -void *_mrealloc(void *p, size_t size, const char *file, int line, const char *func); -char *_mstrdup(const char *p, const char *file, int line, const char *func); -void _mfree(void *p, const char *file, int line, const char *func); +# define aMalloc(n) _mmalloc(n,ALC_MARK) +# define aCalloc(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) + + void* _mmalloc (size_t size, const char *file, int line, const char *func); + void* _mcalloc (size_t num, size_t size, const char *file, int line, const char *func); + void* _mrealloc (void *p, size_t size, const char *file, int line, const char *func); + char* _mstrdup (const char *p, const char *file, int line, const char *func); + void _mfree (void *p, const char *file, int line, const char *func); #else -# define aMalloc(n) aMalloc_((n),ALC_MARK) -# define aCalloc(m,n) aCalloc_((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) +# define aMalloc(n) aMalloc_((n),ALC_MARK) +# define aCalloc(m,n) aCalloc_((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 *aCalloc_(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); + void* aMalloc_ (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* 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 @@ -66,13 +66,13 @@ void aFree_(void *p, const char *file, int line, const char *func); #ifdef __GNUC__ // GCC has variable length arrays -#define CREATE_BUFFER(name, type, size) type name[size] -#define DELETE_BUFFER(name) + #define CREATE_BUFFER(name, type, size) type name[size] + #define DELETE_BUFFER(name) #else // others don't, so we emulate them -#define CREATE_BUFFER(name, type, size) type *name = (type *) aCalloc (size, sizeof(type)) -#define DELETE_BUFFER(name) aFree(name) + #define CREATE_BUFFER(name, type, size) type *name = (type *) aCalloc (size, sizeof(type)) + #define DELETE_BUFFER(name) aFree(name) #endif @@ -84,9 +84,9 @@ void aFree_(void *p, const char *file, int line, const char *func); //////////////////////////////////////////////// void malloc_memory_check(void); -bool malloc_verify_ptr(void *ptr); -size_t malloc_usage(void); -void malloc_init(void); -void malloc_final(void); +bool malloc_verify_ptr(void* ptr); +size_t malloc_usage (void); +void malloc_init (void); +void malloc_final (void); #endif /* _MALLOC_H_ */ -- cgit v1.2.3-60-g2f50