[libc] Breakup freelist_malloc into separate files (#119806)

This better matches the structure we use for the rest of libc.
This commit is contained in:
Petr Hosek
2024-12-16 10:30:27 -08:00
committed by GitHub
parent 0a7e048667
commit 7bf3137c39
17 changed files with 204 additions and 119 deletions

View File

@@ -24,10 +24,21 @@ add_libc_fuzzer(
-D__LIBC_EXPLICIT_SIMD_OPT
)
add_libc_fuzzer(
freelist_heap_fuzz
SRCS
freelist_heap_fuzz.cpp
DEPENDS
libc.src.__support.freelist_heap
)
if(LLVM_LIBC_FULL_BUILD)
add_libc_fuzzer(
freelist_heap_fuzz
SRCS
fake_heap.s
freelist_heap_fuzz.cpp
DEPENDS
libc.src.__support.freelist_heap
)
# TODO(#119995): Remove this once sccache on Windows no longer requires
# the use of -DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded.
get_fq_target_name(freelist_heap_fuzz freelist_heap_fuzz_target_name)
set_target_properties(
${freelist_heap_fuzz_target_name}
PROPERTIES
MSVC_DEBUG_INFORMATION_FORMAT ""
)
endif()

View File

@@ -0,0 +1,15 @@
//===-- Test fake definition for heap symbols -----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
.globl _end, __llvm_libc_heap_limit
.bss
_end:
.fill 1024
__llvm_libc_heap_limit: