aboutsummaryrefslogtreecommitdiffstats
path: root/mmm.h
diff options
context:
space:
mode:
authorZoRo <dos21h@gmail.com>2016-12-15 19:17:14 +0000
committerZoRo <dos21h@gmail.com>2016-12-15 19:17:14 +0000
commita588aa017512d3cc70dde6627d1218020e755259 (patch)
treea070cd171d18f3efbaedb7cfa0f9d54e2bb3b362 /mmm.h
downloadagni-a588aa017512d3cc70dde6627d1218020e755259.tar.gz
agni-a588aa017512d3cc70dde6627d1218020e755259.zip
Initial commit
Diffstat (limited to 'mmm.h')
-rw-r--r--mmm.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/mmm.h b/mmm.h
new file mode 100644
index 0000000..4b1c368
--- /dev/null
+++ b/mmm.h
@@ -0,0 +1,50 @@
+#ifndef __LIBMM_MMM_H
+#define __LIBMM_MMM_H
+
+#define _GNU_SOURCE
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdint.h>
+#include <dlfcn.h>
+
+#include "mmm_config.h"
+
+//----------------------------------------------------------------------
+#ifdef MMM_PLAIN
+
+#define MALLOC(SIZE) malloc(SIZE);
+#define FREE(PTR) free(PTR);
+#define CALLOC(NMEMB,SIZE) calloc(NMEMB, SIZE);
+#define REALLOC(PTR,SIZE) realloc(PTR,SIZE);
+
+#endif
+
+//----------------------------------------------------------------------
+#ifdef MMM_PLAIN_SAFE
+
+#define MALLOC(SIZE) malloc(SIZE);
+#define FREE(PTR) if (PTR!=NULL){free(PTR);PTR=NULL;};
+#define CALLOC(NMEMB,SIZE) calloc(NMEMB, SIZE);
+#define REALLOC(PTR,SIZE) realloc(PTR,SIZE);
+
+#endif
+
+//----------------------------------------------------------------------
+#ifdef MMM_RECORD
+
+#define MALLOC(SIZE) mmm_malloc(SIZE,__FILE__,__LINE__);
+#define FREE(PTR) mmm_free((PTR),__FILE__,__LINE__);
+#define CALLOC(NMEMB,SIZE) calloc(NMEMB,SIZE);
+#define REALLOC(PTR,SIZE) realloc(PTR,SIZE);
+
+void* mmm_malloc(size_t, const char *, int );
+void mmm_free( void *, const char *, int );
+
+#endif
+
+
+
+
+#endif