blob: 8261fee783f0f4ac1ab0ebdc807e8d25cef0e830 [file] [log] [blame]
Hisham Muhammadd6231ba2006-03-04 18:16:49 +00001/* 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
22typedef struct DebugMemoryItem_ DebugMemoryItem;
23
24struct DebugMemoryItem_ {
25 void* data;
26 char* file;
27 int line;
28 DebugMemoryItem* next;
29};
30
31typedef struct DebugMemory_ {
32 DebugMemoryItem* first;
33 int allocations;
34 int deallocations;
35 int size;
36 FILE* file;
37} DebugMemory;
38
39
40void DebugMemory_new();
41
42void* DebugMemory_malloc(int size, char* file, int line);
43
44void* DebugMemory_calloc(int a, int b, char* file, int line);
45
46void* DebugMemory_realloc(void* ptr, int size, char* file, int line);
47
48void* DebugMemory_strdup(char* str, char* file, int line);
49
50void DebugMemory_free(void* data, char* file, int line);
51
52void DebugMemory_assertSize();
53
54int DebugMemory_getBlockCount();
55
56void DebugMemory_registerAllocation(void* data, char* file, int line);
57
58void DebugMemory_registerDeallocation(void* data, char* file, int line);
59
60void DebugMemory_report();
61
62#endif