diff options
author | (no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-11-04 23:25:09 +0000 |
---|---|---|
committer | (no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-11-04 23:25:09 +0000 |
commit | 195dffc20af1fb32c7e4119988911b72955aeabc (patch) | |
tree | b60d2a5e72d64dc5fc21eb9ce0962631e774a4c9 /src/common/malloc.c | |
download | hercules-195dffc20af1fb32c7e4119988911b72955aeabc.tar.gz hercules-195dffc20af1fb32c7e4119988911b72955aeabc.tar.bz2 hercules-195dffc20af1fb32c7e4119988911b72955aeabc.tar.xz hercules-195dffc20af1fb32c7e4119988911b72955aeabc.zip |
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/athena@2 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/malloc.c')
-rw-r--r-- | src/common/malloc.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/common/malloc.c b/src/common/malloc.c new file mode 100644 index 000000000..bc40c6a3f --- /dev/null +++ b/src/common/malloc.c @@ -0,0 +1,44 @@ +#include <stdio.h>
+#include <stdlib.h>
+#include "malloc.h"
+
+void* aMalloc_( size_t size, const char *file, int line, const char *func )
+{
+ void *ret;
+
+// printf("%s:%d: in func %s: malloc %d\n",file,line,func,size);
+ ret=malloc(size);
+ if(ret==NULL){
+ printf("%s:%d: in func %s: malloc error out of memory!\n",file,line,func);
+ exit(1);
+
+ }
+ return ret;
+}
+void* aCalloc_( size_t num, size_t size, const char *file, int line, const char *func )
+{
+ void *ret;
+
+// printf("%s:%d: in func %s: calloc %d %d\n",file,line,func,num,size);
+ ret=calloc(num,size);
+ if(ret==NULL){
+ printf("%s:%d: in func %s: calloc error out of memory!\n",file,line,func);
+ exit(1);
+
+ }
+ return ret;
+}
+
+void* aRealloc_( void *p, size_t size, const char *file, int line, const char *func )
+{
+ void *ret;
+
+// printf("%s:%d: in func %s: realloc %p %d\n",file,line,func,p,size);
+ ret=realloc(p,size);
+ if(ret==NULL){
+ printf("%s:%d: in func %s: realloc error out of memory!\n",file,line,func);
+ exit(1);
+
+ }
+ return ret;
+}
|