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)
380380 aligned_alloc
381381 )
382382else ()
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)
385396 add_entrypoint_object(
386397 malloc
387- SRCS
388- freelist_malloc.cpp
389- HDRS
390- malloc.h
398+ ALIAS
391399 DEPENDS
392- libc.src.__support.freelist_heap
393- COMPILE_OPTIONS
394- -DLIBC_FREELIST_MALLOC_SIZE=${LIBC_CONF_FREELIST_MALLOC_BUFFER_SIZE}
400+ .freelist_malloc
395401 )
396402 else ()
397403 add_entrypoint_external(
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ if(LLVM_LIBC_FULL_BUILD)
3636 DEPENDS
3737 libc.src.__support.CPP.span
3838 libc.src.__support.freelist_heap
39- libc.src.stdlib.malloc
39+ libc.src.stdlib.freelist_malloc
4040 libc.src.string .memcmp
4141 libc.src.string .memcpy
4242 )
You can’t perform that action at this time.
0 commit comments