Browse Source

core: mem - shm common defines to pass the module name

Stefan Mititelu 10 years ago
parent
commit
1755c1b7d6
2 changed files with 11 additions and 11 deletions
  1. 1 1
      mem/shm_mem.c
  2. 10 10
      mem/shm_mem.h

+ 1 - 1
mem/shm_mem.c

@@ -94,7 +94,7 @@ inline static void* sh_realloc(void* p, unsigned int size)
 
 #ifdef DBG_QM_MALLOC
 void* _shm_resize( void* p, unsigned int s, const char* file, const char* func,
-							int line)
+							int line, const char *mname)
 #else
 void* _shm_resize( void* p , unsigned int s)
 #endif

+ 10 - 10
mem/shm_mem.h

@@ -211,41 +211,41 @@ void shm_mem_destroy(void);
 #include "src_loc.h"
 
 #define shm_malloc_unsafe(_size ) \
-	MY_MALLOC(shm_block, (_size), _SRC_LOC_, _SRC_FUNCTION_, _SRC_LINE_ )
+	MY_MALLOC(shm_block, (_size), _SRC_LOC_, _SRC_FUNCTION_, _SRC_LINE_, _SRC_MODULE_)
 
 
 inline static void* _shm_malloc(unsigned int size, 
-	const char *file, const char *function, int line )
+	const char *file, const char *function, int line, const char *mname)
 {
 	void *p;
 	
 	shm_lock();
-	p=MY_MALLOC(shm_block, size, file, function, line );
+	p=MY_MALLOC(shm_block, size, file, function, line, mname);
 	shm_unlock();
 	return p; 
 }
 
 
 inline static void* _shm_realloc(void *ptr, unsigned int size, 
-		const char* file, const char* function, int line )
+		const char* file, const char* function, int line, const char *mname)
 {
 	void *p;
 	shm_lock();
-	p=MY_REALLOC(shm_block, ptr, size, file, function, line);
+	p=MY_REALLOC(shm_block, ptr, size, file, function, line, mname);
 	shm_unlock();
 	return p;
 }
 
 #define shm_malloc( _size ) _shm_malloc((_size), \
-	_SRC_LOC_, _SRC_FUNCTION_, _SRC_LINE_ )
+	_SRC_LOC_, _SRC_FUNCTION_, _SRC_LINE_ , _SRC_MODULE_)
 
 #define shm_realloc( _ptr, _size ) _shm_realloc( (_ptr), (_size), \
-	_SRC_LOC_, _SRC_FUNCTION_, _SRC_LINE_ )
+	_SRC_LOC_, _SRC_FUNCTION_, _SRC_LINE_, _SRC_MODULE_)
 
 
 
 #define shm_free_unsafe( _p  ) \
-	MY_FREE( shm_block, (_p), _SRC_LOC_, _SRC_FUNCTION_, _SRC_LINE_ )
+	MY_FREE( shm_block, (_p), _SRC_LOC_, _SRC_FUNCTION_, _SRC_LINE_, _SRC_MODULE_)
 
 #define shm_free(_p) \
 do { \
@@ -257,9 +257,9 @@ do { \
 
 
 void* _shm_resize(void* ptr, unsigned int size, const char* f, const char* fn,
-					int line);
+					int line, const char *mname);
 #define shm_resize(_p, _s ) _shm_resize((_p), (_s), \
-		_SRC_LOC_, _SRC_FUNCTION_, _SRC_LINE_ )
+		_SRC_LOC_, _SRC_FUNCTION_, _SRC_LINE_, _SRC_MODULE_)
 /*#define shm_resize(_p, _s ) shm_realloc( (_p), (_s))*/