NeoMutt  2019-12-07
Teaching an old dog new tricks
DOXYGEN
memory.h
Go to the documentation of this file.
1 
23 #ifndef MUTT_LIB_MEMORY_H
24 #define MUTT_LIB_MEMORY_H
25 
26 #include <stddef.h>
27 
28 #undef MAX
29 #undef MIN
30 #define MAX(a, b) (((a) < (b)) ? (b) : (a))
31 #define MIN(a, b) (((a) < (b)) ? (a) : (b))
32 
33 #define mutt_array_size(x) (sizeof(x) / sizeof((x)[0]))
34 
35 void *mutt_mem_calloc(size_t nmemb, size_t size);
36 void mutt_mem_free(void *ptr);
37 void *mutt_mem_malloc(size_t size);
38 void mutt_mem_realloc(void *ptr, size_t size);
39 
40 #define FREE(x) mutt_mem_free(x)
41 
42 #endif /* MUTT_LIB_MEMORY_H */
void mutt_mem_realloc(void *ptr, size_t size)
Resize a block of memory on the heap.
Definition: memory.c:114
void * mutt_mem_malloc(size_t size)
Allocate memory on the heap.
Definition: memory.c:90
void mutt_mem_free(void *ptr)
Release memory allocated on the heap.
Definition: memory.c:68
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:50