Index: src/platform-posix.cc |
diff --git a/src/platform-posix.cc b/src/platform-posix.cc |
index c4b0fb8226e79e98d2a1d30a4dd565b56b569e53..83f6c8112edf0732e4de957779e393d13d2deda3 100644 |
--- a/src/platform-posix.cc |
+++ b/src/platform-posix.cc |
@@ -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 |