genode/qt4/src/lib/qt4/patches/qt4_webkit_munmap.patch

35 lines
1.2 KiB
Diff

Webkit: don't crash because of unimplemented partial unmap
From: Christian Prochaska <christian.prochaska@genode-labs.com>
---
.../Source/JavaScriptCore/wtf/OSAllocatorPosix.cpp | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/OSAllocatorPosix.cpp b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/OSAllocatorPosix.cpp
index 5ba5410..e17316f 100644
--- a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/OSAllocatorPosix.cpp
+++ b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/OSAllocatorPosix.cpp
@@ -150,9 +150,20 @@ void OSAllocator::decommit(void* address, size_t bytes)
void OSAllocator::releaseDecommitted(void* address, size_t bytes)
{
+#if OS(GENODE)
+ /*
+ * 'releaseDecommitted()' sometimes gets called with a start address
+ * different than the one returned by 'mmap()' to release only a part of the
+ * allocated memory. This feature is currently not supported by Genode's
+ * 'munmap()' implementation, so we don't crash on purpose if the result of
+ * 'munmap()' is -1.
+ */
+ munmap(address, bytes);
+#else
int result = munmap(address, bytes);
if (result == -1)
CRASH();
+#endif
}
} // namespace WTF