Skip to content

Commit 519d471

Browse files
committed
[WIP][libc] Add freelist malloc
1 parent f078548 commit 519d471

File tree

14 files changed

+1985
-18
lines changed

14 files changed

+1985
-18
lines changed

libc/config/baremetal/riscv/entrypoints.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ set(TARGET_LIBC_ENTRYPOINTS
170170
libc.src.stdlib.ldiv
171171
libc.src.stdlib.llabs
172172
libc.src.stdlib.lldiv
173+
libc.src.stdlib.malloc
173174
libc.src.stdlib.qsort
174175
libc.src.stdlib.rand
175176
libc.src.stdlib.srand

libc/src/stdlib/CMakeLists.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,20 @@ elseif(LIBC_TARGET_OS_IS_GPU)
380380
aligned_alloc
381381
)
382382
else()
383-
add_entrypoint_external(
383+
add_entrypoint_object(
384384
malloc
385+
SRCS
386+
freelist_malloc.cpp
387+
HDRS
388+
malloc.h
389+
DEPENDS
390+
libc.src.__support.CPP.new
391+
libc.src.__support.CPP.optional
392+
libc.src.__support.CPP.span
393+
libc.src.__support.CPP.type_traits
394+
libc.src.__support.fixedvector
395+
libc.src.string.memcpy
396+
libc.src.string.memset
385397
)
386398
add_entrypoint_external(
387399
free

0 commit comments

Comments
 (0)