mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +00:00
AK+LibGfx+LibJS: Pass -1 as the file descriptor to anonymous mmap
Serenity/Linux/macOS ignore the file descriptor when an anonymous mapping is requested. However, BSDs require the fd to be -1.
This commit is contained in:
parent
4bed2ef66b
commit
42e22f89a4
Notes:
sideshowbarker
2024-07-17 08:46:15 +09:00
Author: https://github.com/BertalanD
Commit: 42e22f89a4
Pull-request: https://github.com/SerenityOS/serenity/pull/14539
Reviewed-by: https://github.com/ADKaster
3 changed files with 3 additions and 3 deletions
|
@ -23,7 +23,7 @@ BasicBlock::BasicBlock(String name, size_t size)
|
|||
// The main issue we're working around here is that we don't want pointers into the bytecode stream to become invalidated
|
||||
// during code generation due to dynamic buffer resizing. Otherwise we could just use a Vector.
|
||||
m_buffer_capacity = size;
|
||||
m_buffer = (u8*)mmap(nullptr, m_buffer_capacity, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
|
||||
m_buffer = (u8*)mmap(nullptr, m_buffer_capacity, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
|
||||
VERIFY(m_buffer != MAP_FAILED);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue