mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
parent
58bc10b947
commit
b8fd845885
Notes:
sideshowbarker
2024-07-18 17:17:50 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/b8fd8458850
1 changed files with 10 additions and 2 deletions
|
@ -33,8 +33,16 @@ BlockAllocator::~BlockAllocator()
|
|||
|
||||
void* BlockAllocator::allocate_block([[maybe_unused]] char const* name)
|
||||
{
|
||||
if (!m_blocks.is_empty())
|
||||
return m_blocks.take_last();
|
||||
if (!m_blocks.is_empty()) {
|
||||
auto* block = m_blocks.take_last();
|
||||
#ifdef __serenity__
|
||||
if (set_mmap_name(block, HeapBlock::block_size, name) < 0) {
|
||||
perror("set_mmap_name");
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
#endif
|
||||
return block;
|
||||
}
|
||||
|
||||
#ifdef __serenity__
|
||||
auto* block = (HeapBlock*)serenity_mmap(nullptr, HeapBlock::block_size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_RANDOMIZED | MAP_PRIVATE, 0, 0, HeapBlock::block_size, name);
|
||||
|
|
Loading…
Add table
Reference in a new issue