Skip to content

Commit fdc6f51

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 e20b904 commit fdc6f51

File tree

4 files changed

+1077
-0
lines changed

4 files changed

+1077
-0
lines changed

libc/src/stdlib/CMakeLists.txt

+12
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,18 @@ elseif(LIBC_TARGET_OS_IS_GPU)
380380
aligned_alloc
381381
)
382382
else()
383+
add_header_library(
384+
block
385+
HDRS
386+
block.h
387+
DEPENDS
388+
libc.src.__support.CPP.algorithm
389+
libc.src.__support.CPP.limits
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+
)
383395
add_entrypoint_external(
384396
malloc
385397
)

0 commit comments

Comments
 (0)