Skip to content

Commit 4b05af8

Browse files
committed
[libc][stdlib] Add Block class
A block represents a chunk of memory used by the freelist allocator. It contains header information denoting the usable space and pointers as offsets to the next and previous block. On it's own, this doesn't do much. This is a part of #94270 to land in smaller patches. This is a subset of pigweed's freelist allocator implementation.
1 parent 2e0e163 commit 4b05af8

File tree

4 files changed

+1058
-0
lines changed

4 files changed

+1058
-0
lines changed

libc/src/stdlib/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,18 @@ elseif(LIBC_TARGET_OS_IS_GPU)
379379
aligned_alloc
380380
)
381381
else()
382+
add_header_library(
383+
block
384+
HDRS
385+
block.h
386+
DEPENDS
387+
libc.src.__support.CPP.algorithm
388+
libc.src.__support.CPP.limits
389+
libc.src.__support.CPP.new
390+
libc.src.__support.CPP.optional
391+
libc.src.__support.CPP.span
392+
libc.src.__support.CPP.type_traits
393+
)
382394
add_entrypoint_external(
383395
malloc
384396
)

0 commit comments

Comments
 (0)