File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -380,18 +380,24 @@ elseif(LIBC_TARGET_OS_IS_GPU)
380
380
aligned_alloc
381
381
)
382
382
else ()
383
- # Only add malloc in full build mode. Use the system malloc in overlay mode.
384
- if (LLVM_LIBC_FULL_BUILD )
383
+ # Only use freelist malloc for baremetal targets.
384
+ add_entrypoint_object (
385
+ freelist_malloc
386
+ SRCS
387
+ freelist_malloc.cpp
388
+ HDRS
389
+ malloc.h
390
+ DEPENDS
391
+ libc.src.__support.freelist_heap
392
+ COMPILE_OPTIONS
393
+ -DLIBC_FREELIST_MALLOC_SIZE=${LIBC_CONF_FREELIST_MALLOC_BUFFER_SIZE}
394
+ )
395
+ if (LIBC_TARGET_OS_IS_BAREMETAL )
385
396
add_entrypoint_object (
386
397
malloc
387
- SRCS
388
- freelist_malloc.cpp
389
- HDRS
390
- malloc.h
398
+ ALIAS
391
399
DEPENDS
392
- libc.src.__support.freelist_heap
393
- COMPILE_OPTIONS
394
- -DLIBC_FREELIST_MALLOC_SIZE=${LIBC_CONF_FREELIST_MALLOC_BUFFER_SIZE}
400
+ .freelist_malloc
395
401
)
396
402
else ()
397
403
add_entrypoint_external (
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ if(LLVM_LIBC_FULL_BUILD)
36
36
DEPENDS
37
37
libc.src.__support.CPP.span
38
38
libc.src.__support.freelist_heap
39
- libc.src.stdlib.malloc
39
+ libc.src.stdlib.freelist_malloc
40
40
libc.src.string.memcmp
41
41
libc.src.string.memcpy
42
42
)
You can’t perform that action at this time.
0 commit comments