openbsd-ports/www/chromium/patches/patch-v8_src_platform-posix_cc
robert c480666f7d Instead of reserving 32MB of virtual memory let's reserve the quarter of
RLIMIT_DATA (ulimit -d) if RLIMIT_DATA is not 0 (unlimited).
If RLIMIT_DATA is 0 then the default 512MB reservation will be used.
Using 32MB made v8 use less memory for sure but it was a huge performance
loss too.
2011-06-02 07:21:14 +00:00

23 lines
611 B
Plaintext

$OpenBSD: patch-v8_src_platform-posix_cc,v 1.1 2011/06/02 07:22:12 robert Exp $
--- v8/src/platform-posix.cc.orig Fri May 20 10:56:51 2011
+++ v8/src/platform-posix.cc Wed Jun 1 13:43:18 2011
@@ -54,6 +54,18 @@
namespace v8 {
namespace internal {
+
+// Maximum size of the virtual memory. 0 means there is no artificial
+// limit.
+
+intptr_t OS::MaxVirtualMemory() {
+ struct rlimit limit;
+ int result = getrlimit(RLIMIT_DATA, &limit);
+ if (result != 0) return 0;
+ return limit.rlim_cur;
+}
+
+
// ----------------------------------------------------------------------------
// Math functions