loader: add knob to build with user malloc

This option is intended to aid development, to allow building with user malloc.
The use case would be to build userboot & test with libc (or other) malloc and
use extra malloc debug features.
This commit is contained in:
Toomas Soome 2020-03-28 21:47:44 +00:00
parent 103d3266eb
commit c907ec9e16

View File

@ -436,7 +436,14 @@ extern void mallocstats(void);
const char *x86_hypervisor(void);
#ifdef DEBUG_MALLOC
#ifdef USER_MALLOC
extern void *malloc(size_t);
extern void *memalign(size_t, size_t);
extern void *calloc(size_t, size_t);
extern void free(void *);
extern void *realloc(void *, size_t);
extern void *reallocf(void *, size_t);
#elif DEBUG_MALLOC
#define malloc(x) Malloc(x, __FILE__, __LINE__)
#define memalign(x, y) Memalign(x, y, __FILE__, __LINE__)
#define calloc(x, y) Calloc(x, y, __FILE__, __LINE__)