34 if(
unlikely(mem_size && ret == NULL)) {
64 void *ret = malloc(mem_size);
66 if(__builtin_expect(mem_size && !ret, 0)) {
82 static inline void *
mm_realloc(
void *ptr,
size_t mem_size)
84 void *ret = realloc(ptr, mem_size);
86 if(__builtin_expect(mem_size && !ret, 0)) {
@ LOG_FATAL
The logging level reserved to unexpected, fatal conditions.
Definition: ROOT-Sim.h:113
Core ROOT-Sim functionalities.
#define unlikely(exp)
Optimize the branch as likely not taken.
Definition: core.h:51
#define logger(level,...)
Produce a log message.
Definition: log.h:22
Platform specific memory utilities.
#define mem_aligned_free(mem)
An OS-dependent function to free aligned memory.
Definition: mem.h:27
#define mem_aligned_alloc(align, mem_size)
An OS-dependent function to allocate aligned memory.
Definition: mem.h:25
static void * mm_alloc(size_t mem_size)
A version of the stdlib malloc() used internally.
Definition: mm.h:62
static void * mm_aligned_alloc(size_t alignment, size_t mem_size)
A version of the stdlib aligned_alloc() used internally.
Definition: mm.h:30
static void * mm_realloc(void *ptr, size_t mem_size)
A version of the stdlib realloc() used internally.
Definition: mm.h:82
static void mm_free(void *ptr)
A version of the stdlib free() used internally.
Definition: mm.h:97
static void mm_aligned_free(void *ptr)
A version of the stdlib free() for aligned blocks used internally.
Definition: mm.h:48