mkernel 0.0.1
Micro-kernel framework, everything as a module
memdbg.h
Go to the documentation of this file.
1
19#ifndef __MEMDBG_H__
20#define __MEMDBG_H__
21
22#ifdef HAVE_CONFIG_H
23# include "config.h"
24#endif
25
26#ifndef NDEBUG
27
28#include "memtrack.h"
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
48void *dbg_malloc(const size_t Size,
49 const char *File,
50 const int Line,
51 const char *CompilDate,
52 const char *CompilTime,
53 const char *Function);
54
73void dbg_free(void *Ptr,
74 const char *File,
75 const int Line,
76 const char *CompilDate,
77 const char *CompilTime,
78 const char *Function);
79
98void *dbg_calloc(const size_t NMemb,
99 const size_t Size,
100 const char *File,
101 const int Line,
102 const char *CompilDate,
103 const char *CompilTime,
104 const char *Function);
105
134void *dbg_realloc(void *Ptr,
135 const size_t Size,
136 const char *File,
137 const int Line,
138 const char *CompilDate,
139 const char *CompilTime,
140 const char *Function);
141
156char *dbg_strdup(const char *Ptr,
157 const char *File,
158 const int Line,
159 const char *CompilDate,
160 const char *CompilTime,
161 const char *Function);
162
179int dbg_asprintf(char **p_Ptr,
180 const char *p_Format,
181 const char *File,
182 const int Line,
183 const char *CompilDate,
184 const char *CompilTime,
185 const char *Function,
186 ...);
187
188#ifdef __cplusplus
189}
190#endif
191
192#endif /* NDEBUG */
193#endif /* __MEMDBG_H__ */
194
void * dbg_malloc(const size_t Size, const char *File, const int Line, const char *CompilDate, const char *CompilTime, const char *Function)
Malloc compatible standard allocation.
Definition: memdbg.c:25
void * dbg_calloc(const size_t NMemb, const size_t Size, const char *File, const int Line, const char *CompilDate, const char *CompilTime, const char *Function)
Allocate a table of item from the size of each and number.
Definition: memdbg.c:76
void * dbg_realloc(void *Ptr, const size_t Size, const char *File, const int Line, const char *CompilDate, const char *CompilTime, const char *Function)
Resize an already allocated and tracked block.
Definition: memdbg.c:102
int dbg_asprintf(char **p_Ptr, const char *p_Format, const char *File, const int Line, const char *CompilDate, const char *CompilTime, const char *Function,...)
Build a formatted string with allocation.
Definition: memdbg.c:196
void dbg_free(void *Ptr, const char *File, const int Line, const char *CompilDate, const char *CompilTime, const char *Function)
Free compatible standard memory release.
Definition: memdbg.c:52
char * dbg_strdup(const char *Ptr, const char *File, const int Line, const char *CompilDate, const char *CompilTime, const char *Function)
String duplication with allocation.
Definition: memdbg.c:163
Memory block metadata tracking headers.