| version 1.1 | | version 1.2 |
|---|
| | |
| * Headers for safe malloc stuff. | | * Headers for safe malloc stuff. |
| * | | * |
| * $Log$ | | * $Log$ |
| * Revision 1.1 1999/06/14 22:02:25 donut | | * Revision 1.2 1999/08/05 22:53:41 sekmu |
| * Initial revision | | * |
| | | * D3D patch(es) from ADB |
| | | * |
| | | * Revision 1.1.1.1 1999/06/14 22:02:25 donut |
| | | * Import of d1x 1.37 source. |
| * | | * |
| * Revision 1.6 1995/02/12 18:40:50 matt | | * Revision 1.6 1995/02/12 18:40:50 matt |
| * Made free() work the way it used to when debugging is on | | * Made free() work the way it used to when debugging is on |
| | |
| | | |
| #ifndef NDEBUG | | #ifndef NDEBUG |
| #include <stdlib.h> | | #include <stdlib.h> |
| | | #include <string.h> |
| //extern int show_mem_info; | | //extern int show_mem_info; |
| | | |
| void * mem_display_blocks(); | | void * mem_display_blocks(); |
| | |
| #define malloc(size) mem_malloc((size),"Unknown", __FILE__,__LINE__, 0 ) | | #define malloc(size) mem_malloc((size),"Unknown", __FILE__,__LINE__, 0 ) |
| #define calloc(n,size) mem_malloc((n*size),"Unknown", __FILE__,__LINE__, 1 ) | | #define calloc(n,size) mem_malloc((n*size),"Unknown", __FILE__,__LINE__, 1 ) |
| #define free(ptr) do{ mem_free(ptr); ptr=NULL; } while(0) | | #define free(ptr) do{ mem_free(ptr); ptr=NULL; } while(0) |
| | | #define strdup(ptr) strcpy(malloc(strlen(ptr)+1),ptr) |
| | | |
| #define MALLOC( var, type, count ) (var=(type *)mem_malloc((count)*sizeof(type),#var, __FILE__,__LINE__,0 )) | | #define MALLOC( var, type, count ) (var=(type *)mem_malloc((count)*sizeof(type),#var, __FILE__,__LINE__,0 )) |
| | | |