summaryrefslogtreecommitdiff
path: root/src/common/malloc.c
diff options
context:
space:
mode:
authorwizputer <wizputer@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-27 19:32:30 +0000
committerwizputer <wizputer@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-27 19:32:30 +0000
commit486b4f2a12b41507b67a1a93ae5871b3be447914 (patch)
tree8196d22d0fce973ac6e53b24735776ba9dcaf77f /src/common/malloc.c
parentecb15e6101bc1912bb2520151c45ed69af80feb8 (diff)
parentf0da8da932031212f34aa97eff882f72cb69cc2a (diff)
downloadhercules-486b4f2a12b41507b67a1a93ae5871b3be447914.tar.gz
hercules-486b4f2a12b41507b67a1a93ae5871b3be447914.tar.bz2
hercules-486b4f2a12b41507b67a1a93ae5871b3be447914.tar.xz
hercules-486b4f2a12b41507b67a1a93ae5871b3be447914.zip
correct directory structure
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@387 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/malloc.c')
-rw-r--r--src/common/malloc.c44
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..eda9bc218
--- /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;
+}