|
6 | 6 | // |
7 | 7 | //===----------------------------------------------------------------------===// |
8 | 8 |
|
| 9 | +#include "src/stdlib/aligned_alloc.h" |
9 | 10 | #include "src/__support/freelist_heap.h" |
10 | 11 | #include "src/__support/macros/config.h" |
11 | | -#include "src/stdlib/aligned_alloc.h" |
12 | | -#include "src/stdlib/calloc.h" |
13 | | -#include "src/stdlib/free.h" |
14 | | -#include "src/stdlib/malloc.h" |
15 | | -#include "src/stdlib/realloc.h" |
16 | 12 |
|
17 | 13 | #include <stddef.h> |
18 | 14 |
|
19 | 15 | namespace LIBC_NAMESPACE_DECL { |
20 | 16 |
|
21 | | -static LIBC_CONSTINIT FreeListHeap freelist_heap_symbols; |
22 | | -FreeListHeap *freelist_heap = &freelist_heap_symbols; |
23 | | - |
24 | | -LLVM_LIBC_FUNCTION(void *, malloc, (size_t size)) { |
25 | | - return freelist_heap->allocate(size); |
26 | | -} |
27 | | - |
28 | | -LLVM_LIBC_FUNCTION(void, free, (void *ptr)) { return freelist_heap->free(ptr); } |
29 | | - |
30 | | -LLVM_LIBC_FUNCTION(void *, calloc, (size_t num, size_t size)) { |
31 | | - return freelist_heap->calloc(num, size); |
32 | | -} |
33 | | - |
34 | | -LLVM_LIBC_FUNCTION(void *, realloc, (void *ptr, size_t size)) { |
35 | | - return freelist_heap->realloc(ptr, size); |
36 | | -} |
37 | | - |
38 | 17 | LLVM_LIBC_FUNCTION(void *, aligned_alloc, (size_t alignment, size_t size)) { |
39 | 18 | return freelist_heap->aligned_allocate(alignment, size); |
40 | 19 | } |
|
0 commit comments