mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05:00
LibJS: Don't generate unused HeapBlock names on non-SerenityOS systems
These are just ignored by the BlockAllocator anyway.
This commit is contained in:
parent
095accd2b2
commit
b458090d14
1 changed files with 4 additions and 0 deletions
|
@ -20,8 +20,12 @@ namespace JS {
|
|||
|
||||
NonnullOwnPtr<HeapBlock> 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<HeapBlock*>(heap.block_allocator().allocate_block(name));
|
||||
new (block) HeapBlock(heap, cell_size);
|
||||
return NonnullOwnPtr<HeapBlock>(NonnullOwnPtr<HeapBlock>::Adopt, *block);
|
||||
|
|
Loading…
Add table
Reference in a new issue