[libc-commits] [libc] [libc] Lazily initialize freelist malloc using symbols (PR #99254)
Daniel Thornburgh via libc-commits
libc-commits at lists.llvm.org
Mon Jul 22 12:53:08 PDT 2024
================
@@ -30,14 +30,19 @@ using LIBC_NAMESPACE::freelist_heap;
#define TEST_FOR_EACH_ALLOCATOR(TestCase, BufferSize) \
class LlvmLibcFreeListHeapTest##TestCase : public testing::Test { \
public: \
+ FreeListHeapBuffer<BufferSize> fake_global_buffer; \
+ void SetUp() override { \
+ freelist_heap = \
+ new (&fake_global_buffer) FreeListHeapBuffer<BufferSize>; \
+ } \
----------------
mysterymath wrote:
Not for these tests without limitation, since the buffer size is variable, but that does work for the malloc test, which gives us some smoke testing that the symbol version works. That's probably most of what's needed for now; the `morecore` variant should make this more straightfoward to test later. Done.
https://github.com/llvm/llvm-project/pull/99254
More information about the libc-commits
mailing list