|
My Project
programmer's documentation
|
Go to the documentation of this file.
62 #define BFT_MALLOC(_ptr, _ni, _type) \
63 _ptr = (_type *) bft_mem_malloc(_ni, sizeof(_type), \
64 #_ptr, __FILE__, __LINE__)
78 #define BFT_REALLOC(_ptr, _ni, _type) \
79 _ptr = (_type *) bft_mem_realloc(_ptr, _ni, sizeof(_type), \
80 #_ptr, __FILE__, __LINE__)
96 #define BFT_FREE(_ptr) \
97 bft_mem_free(_ptr, #_ptr, __FILE__, __LINE__), _ptr = NULL
101 #define BFT_FREE(_ptr) \
102 _ptr = bft_mem_free(_ptr, #_ptr, __FILE__, __LINE__)
119 #define BFT_MEMALIGN(_ptr, _align, _ni, _type) \
120 _ptr = (_type *) bft_mem_memalign(_align, _ni, sizeof(_type), \
121 #_ptr, __FILE__, __LINE__)
198 const char *var_name,
199 const char *file_name,
226 const char *var_name,
227 const char *file_name,
251 const char *var_name,
252 const char *file_name,
281 const char *var_name,
282 const char *file_name,
#define END_C_DECLS
Definition: cs_defs.h:468
void bft_mem_error_handler_set(bft_error_handler_t *handler)
Associates an error handler with the bft_mem_...() functions.
Definition: bft_mem.c:1187
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
void bft_mem_end(void)
End memory handling.
Definition: bft_mem.c:667
void bft_mem_init(const char *log_file_name)
Initialize memory handling.
Definition: bft_mem.c:590
void * bft_mem_realloc(void *ptr, size_t ni, size_t size, const char *var_name, const char *file_name, int line_num)
Reallocate memory for ni elements of size bytes.
Definition: bft_mem.c:847
void() bft_error_handler_t(const char *const file_name, const int line_num, const int sys_error_code, const char *const format, va_list arg_ptr)
Function pointer to opaque error handler.
Definition: bft_error.h:52
size_t bft_mem_size_max(void)
Return maximum theoretical dynamic memory allocated.
Definition: bft_mem.c:1158
bft_error_handler_t * bft_mem_error_handler_get(void)
Returns the error handler associated with the bft_mem_...() functions.
Definition: bft_mem.c:1170
int bft_mem_have_memalign(void)
Indicate if a memory aligned allocation variant is available.
Definition: bft_mem.c:1201
int bft_mem_initialized(void)
Indicates if bft_mem_...() functions are initialized.
Definition: bft_mem.c:741
size_t bft_mem_size_current(void)
Return current theoretical dynamic memory allocated.
Definition: bft_mem.c:1146
void * bft_mem_free(void *ptr, const char *var_name, const char *file_name, int line_num)
Free allocated memory.
Definition: bft_mem.c:978
void * bft_mem_memalign(size_t alignment, size_t ni, size_t size, const char *var_name, const char *file_name, int line_num)
Allocate aligned memory for ni elements of size bytes.
Definition: bft_mem.c:1051
void * bft_mem_malloc(size_t ni, size_t size, const char *var_name, const char *file_name, int line_num)
Allocate memory for ni elements of size bytes.
Definition: bft_mem.c:763