| Hisham Muhammad | d6231ba | 2006-03-04 18:16:49 +0000 | [diff] [blame] | 1 | /* Do not edit this file. It was automatically genarated. */ |
| 2 | |
| 3 | #ifndef HEADER_DebugMemory |
| 4 | #define HEADER_DebugMemory |
| 5 | |
| 6 | #define _GNU_SOURCE |
| 7 | |
| 8 | #include <stdlib.h> |
| 9 | #include <stdio.h> |
| 10 | #include <string.h> |
| 11 | #include <stdbool.h> |
| 12 | |
| 13 | #include <assert.h> |
| 14 | |
| 15 | |
| 16 | #undef strdup |
| 17 | #undef malloc |
| 18 | #undef realloc |
| 19 | #undef calloc |
| 20 | #undef free |
| 21 | |
| 22 | typedef struct DebugMemoryItem_ DebugMemoryItem; |
| 23 | |
| 24 | struct DebugMemoryItem_ { |
| 25 | void* data; |
| 26 | char* file; |
| 27 | int line; |
| 28 | DebugMemoryItem* next; |
| 29 | }; |
| 30 | |
| 31 | typedef struct DebugMemory_ { |
| 32 | DebugMemoryItem* first; |
| 33 | int allocations; |
| 34 | int deallocations; |
| 35 | int size; |
| 36 | FILE* file; |
| 37 | } DebugMemory; |
| 38 | |
| 39 | |
| 40 | void DebugMemory_new(); |
| 41 | |
| 42 | void* DebugMemory_malloc(int size, char* file, int line); |
| 43 | |
| 44 | void* DebugMemory_calloc(int a, int b, char* file, int line); |
| 45 | |
| 46 | void* DebugMemory_realloc(void* ptr, int size, char* file, int line); |
| 47 | |
| 48 | void* DebugMemory_strdup(char* str, char* file, int line); |
| 49 | |
| 50 | void DebugMemory_free(void* data, char* file, int line); |
| 51 | |
| 52 | void DebugMemory_assertSize(); |
| 53 | |
| 54 | int DebugMemory_getBlockCount(); |
| 55 | |
| 56 | void DebugMemory_registerAllocation(void* data, char* file, int line); |
| 57 | |
| 58 | void DebugMemory_registerDeallocation(void* data, char* file, int line); |
| 59 | |
| 60 | void DebugMemory_report(); |
| 61 | |
| 62 | #endif |