https://bitbucket.org/daniel_fort/magic-lantern
Raw File
Tip revision: f1ca74a673122d9a28f39735c52d53111bbb122b authored by Giovanni Condello on 28 May 2013, 19:29:13 UTC
Close common-gui-c branch
Tip revision: f1ca74a
memcheck.h
#ifndef _memcheck_h_
#define _memcheck_h_

/* this file needs to get included in dryos.h to trace mallc/free and detect errors */

extern void *memcheck_malloc( size_t len, const char *file, unsigned int line, int mode);
extern void *memcheck_free( void * buf, int mode);
//extern void *memcheck_realloc( void * buf, size_t len, const char *file, unsigned int line );

#define malloc(len)         memcheck_malloc(len,__FILE__,__LINE__,1)
#define free(buf)           memcheck_free(buf,1)
//#define realloc(buf,len)    ml_debug_realloc(buf,len,__FILE__,__LINE__)

#define AllocateMemory(len) memcheck_malloc(len,__FILE__,__LINE__,0)
#define FreeMemory(buf)     memcheck_free(buf,0)

#endif
back to top