00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00028 #ifndef __MEMORY_H__
00029 #define __MEMORY_H__
00030
00031 #include <stdlib.h>
00032
00033 #include "../common/platform.h"
00034 #include "../common/common_utils.h"
00035
00036
00037
00038
00039 void *Memory_malloc( size_t size );
00040 void *Memory_calloc( size_t num, size_t size );
00041 void *Memory_realloc( void *memblock, size_t size );
00042 void Memory_free( void *memblock );
00043
00044 void Memory_outofmem( const char *name, const char *file, W32 line );
00045
00046
00047
00048
00049 #define MM_MALLOC( size ) Memory_malloc( (size) )
00050 #define MM_CALLOC( num, size ) Memory_calloc( (num), (size) )
00051 #define MM_REALLOC( memblock, size ) Memory_realloc( (memblock), (size) )
00052
00053 #define MM_FREE( memblock ) { Memory_free( (memblock) ); ((memblock)) = NULL; }
00054
00055 #define MM_OUTOFMEM( name ) Memory_outofmem( (name), __FILE__, __LINE__ )
00056
00057
00058 #define MM_MEMCPY memcpy
00059
00060
00061
00062
00063 #endif