diff options
author | Daniel Bertalan <dani@danielbertalan.dev> | 2022-07-10 15:30:08 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-07-19 12:39:24 +0200 |
commit | 42e22f89a49ff766ae73c0a486b55b1bf4ff44d7 (patch) | |
tree | 4b03e0a81d629afbd7e01086f822fef136629bc6 /Userland/Libraries/LibJS/Bytecode | |
parent | 4bed2ef66b6fc1b7419eeb951d3b479a39fe5076 (diff) | |
download | serenity-42e22f89a49ff766ae73c0a486b55b1bf4ff44d7.zip |
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.
Diffstat (limited to 'Userland/Libraries/LibJS/Bytecode')
-rw-r--r-- | Userland/Libraries/LibJS/Bytecode/BasicBlock.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Bytecode/BasicBlock.cpp b/Userland/Libraries/LibJS/Bytecode/BasicBlock.cpp index 71a14ac7e2..153cad384f 100644 --- a/Userland/Libraries/LibJS/Bytecode/BasicBlock.cpp +++ b/Userland/Libraries/LibJS/Bytecode/BasicBlock.cpp @@ -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); } |