diff options
author | FreeArtMan <dos21h@gmail.com> | 2014-11-16 11:10:23 +0900 |
---|---|---|
committer | FreeArtMan <dos21h@gmail.com> | 2014-11-16 11:10:23 +0900 |
commit | e8574a9621a2cbe50b22aa5aa8114bcebce22b38 (patch) | |
tree | 6e77d3872827926ce108f15e312d699fefbbd23a /mmm.h | |
parent | c84cc88f0b34d8802390e2a7b6dab7f07ba277d1 (diff) | |
download | microbbs-e8574a9621a2cbe50b22aa5aa8114bcebce22b38.tar.gz microbbs-e8574a9621a2cbe50b22aa5aa8114bcebce22b38.zip |
Preparation to article list feature. Added debug.h and mmm.h
Diffstat (limited to 'mmm.h')
-rw-r--r-- | mmm.h | 50 |
1 files changed, 50 insertions, 0 deletions
@@ -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 |