summaryrefslogtreecommitdiff
path: root/src/include/cctki_Malloc.h
diff options
context:
space:
mode:
authorlanfer <lanfer@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-05-05 12:58:49 +0000
committerlanfer <lanfer@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-05-05 12:58:49 +0000
commita350fd59891cb966476c70686aa4121e009d8de9 (patch)
treeeb6875f4e66b2878468fad75d668781e9b447454 /src/include/cctki_Malloc.h
parentdb0533616300c472be4e155f469e5972abd77a40 (diff)
adding an include that provides the redefs for malloc
git-svn-id: http://svn.cactuscode.org/flesh/trunk@1627 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/include/cctki_Malloc.h')
-rw-r--r--src/include/cctki_Malloc.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/include/cctki_Malloc.h b/src/include/cctki_Malloc.h
new file mode 100644
index 00000000..9d43cd7e
--- /dev/null
+++ b/src/include/cctki_Malloc.h
@@ -0,0 +1,24 @@
+#define CCTK_DEBUG_DEBUG
+
+#if defined(CCTK_DEBUG_DEBUG)
+
+#include <stdlib.h>
+
+#undef malloc
+#define malloc(x) CCTKi_Malloc(x,__LINE__,__FILE__)
+
+#undef free
+#define free(x) CCTKi_Free(x,__LINE__,__FILE__)
+
+#undef calloc
+#define calloc(x,y) CCTKi_Calloc(x, y,__LINE__,__FILE__)
+
+#undef realloc
+#define realloc(x,y) CCTKi_Realloc(x, y,__LINE__,__FILE__)
+
+void *CCTKi_Malloc(size_t size, int line, const char *file);
+void CCTKi_Free(void *pointer, int line, const char *file);
+void *CCTKi_Calloc(size_t nmemb, size_t size, int line, const char *file);
+void *CCTKi_Realloc(void *pointer, size_t size, int line, const char *file);
+
+#endif