1
4
5
10
11# ifndef LMT_UTILITIES_MEMORY_H
12# define LMT_UTILITIES_MEMORY_H
13
14
21
22# include <stdlib.h>
23# include <string.h>
24
25# if defined(LUAMETATEX_USE_MIMALLOC)
26 # include "libraries/mimalloc/include/mimalloc.h"
27 # define lmt_memory_malloc mi_malloc
28 # define lmt_memory_calloc mi_calloc
29 # define lmt_memory_realloc mi_realloc
30 # define lmt_memory_free mi_free
31 # define lmt_memory_strdup mi_strdup
32
33
34
35# else
36 # define lmt_memory_malloc malloc
37 # define lmt_memory_calloc calloc
38 # define lmt_memory_realloc realloc
39 # define lmt_memory_free free
40 # define lmt_memory_strdup strdup
41# endif
42
43# define lmt_generic_malloc malloc
44# define lmt_generic_calloc calloc
45# define lmt_generic_realloc realloc
46# define lmt_generic_free free
47# define lmt_generic_strdup strdup
48
49extern void *aux_allocate_array (int recordsize, int size, int reserved);
50extern void *aux_reallocate_array (void *p, int recordsize, int size, int reserved);
51extern void *aux_allocate_clear_array (int recordsize, int size, int reserved);
52extern void aux_deallocate_array (void *p);
53
54# endif
55 |