lexLeo
Loading...
Searching...
No Matches
ast_memory_allocator.h
1// src/core/ast/include/internal/ast_memory_allocator.h
2
3#ifndef AST_MEMORY_ALLOCATOR_H
4#define AST_MEMORY_ALLOCATOR_H
5
6#ifdef USE_MEMORY_ALLOCATOR
7 #include "memory_allocator.h"
8 #define AST_MALLOC(size) get_current_malloc()(size)
9 #define AST_FREE(ptr) get_current_free()(ptr)
10 #define AST_REALLOC(ptr,sz) get_current_realloc()(ptr, sz)
11#else
12 #include <stdlib.h>
13 #define AST_MALLOC(size) malloc(size)
14 #define AST_FREE(ptr) free(ptr)
15 #define AST_REALLOC(ptr,sz) realloc(ptr, sz)
16#endif
17
18#endif //AST_MEMORY_ALLOCATOR_H