From b458090d1403095a52f1965ed394fd91d436fff4 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 13 Jun 2021 11:29:01 +0200 Subject: [PATCH] LibJS: Don't generate unused HeapBlock names on non-SerenityOS systems These are just ignored by the BlockAllocator anyway. --- Userland/Libraries/LibJS/Heap/HeapBlock.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/Libraries/LibJS/Heap/HeapBlock.cpp b/Userland/Libraries/LibJS/Heap/HeapBlock.cpp index 4999be117f..000cac593d 100644 --- a/Userland/Libraries/LibJS/Heap/HeapBlock.cpp +++ b/Userland/Libraries/LibJS/Heap/HeapBlock.cpp @@ -20,8 +20,12 @@ namespace JS { NonnullOwnPtr HeapBlock::create_with_cell_size(Heap& heap, size_t cell_size) { +#ifdef __serenity__ char name[64]; snprintf(name, sizeof(name), "LibJS: HeapBlock(%zu)", cell_size); +#else + char const* name = nullptr; +#endif auto* block = static_cast(heap.block_allocator().allocate_block(name)); new (block) HeapBlock(heap, cell_size); return NonnullOwnPtr(NonnullOwnPtr::Adopt, *block);