aboutsummaryrefslogtreecommitdiffstats
path: root/src/3rdparty
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/masm/wtf/OSAllocatorPosix.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/3rdparty/masm/wtf/OSAllocatorPosix.cpp b/src/3rdparty/masm/wtf/OSAllocatorPosix.cpp
index bbf11e4488..0c902c7172 100644
--- a/src/3rdparty/masm/wtf/OSAllocatorPosix.cpp
+++ b/src/3rdparty/masm/wtf/OSAllocatorPosix.cpp
@@ -191,6 +191,16 @@ void OSAllocator::releaseDecommitted(void* address, size_t bytes)
bool OSAllocator::canAllocateExecutableMemory()
{
+ int flags = MAP_PRIVATE | MAP_ANON;
+#if PLATFORM(IOS)
+ if (executable)
+ flags |= MAP_JIT;
+#endif
+ const auto size = pageSize();
+ void *testPage = mmap(nullptr, size, PROT_READ | PROT_WRITE | PROT_EXEC, flags, /*fd*/-1, /*offset*/0);
+ if (testPage == MAP_FAILED)
+ return false;
+ munmap(testPage, size);
return true;
}