htop/DebugMemory.h

71 lines
1.3 KiB
C
Raw Normal View History

2006-06-06 20:28:42 +00:00
/* Do not edit this file. It was automatically generated. */
2006-03-04 18:16:49 +00:00
#ifndef HEADER_DebugMemory
#define HEADER_DebugMemory
2006-06-06 20:28:42 +00:00
#include <string.h>
2006-03-04 18:16:49 +00:00
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <assert.h>
#undef strdup
#undef malloc
#undef realloc
#undef calloc
#undef free
2006-06-06 20:28:42 +00:00
2006-03-04 18:16:49 +00:00
typedef struct DebugMemoryItem_ DebugMemoryItem;
struct DebugMemoryItem_ {
2006-06-06 20:28:42 +00:00
int magic;
2006-03-04 18:16:49 +00:00
void* data;
char* file;
int line;
DebugMemoryItem* next;
};
typedef struct DebugMemory_ {
DebugMemoryItem* first;
int allocations;
int deallocations;
int size;
2006-06-06 20:28:42 +00:00
bool totals;
2006-03-04 18:16:49 +00:00
FILE* file;
} DebugMemory;
2006-06-06 20:28:42 +00:00
#if defined(DEBUG)
2006-03-04 18:16:49 +00:00
void DebugMemory_new();
2006-06-06 20:28:42 +00:00
void* DebugMemory_malloc(int size, char* file, int line, char* str);
2006-03-04 18:16:49 +00:00
void* DebugMemory_calloc(int a, int b, char* file, int line);
2006-06-06 20:28:42 +00:00
void* DebugMemory_realloc(void* ptr, int size, char* file, int line, char* str);
2006-03-04 18:16:49 +00:00
void* DebugMemory_strdup(const char* str, char* file, int line);
2006-03-04 18:16:49 +00:00
void DebugMemory_free(void* data, char* file, int line);
void DebugMemory_assertSize();
int DebugMemory_getBlockCount();
void DebugMemory_registerAllocation(void* data, char* file, int line);
void DebugMemory_registerDeallocation(void* data, char* file, int line);
void DebugMemory_report();
2006-06-06 20:28:42 +00:00
#elif defined(DEBUGLITE)
//#include "efence.h"
#endif
2006-03-04 18:16:49 +00:00
#endif