Return 0 as maximal amount of physical memory if there is no limit.
authorjochen@chromium.org <jochen@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 8 Apr 2014 17:19:15 +0000 (17:19 +0000)
committerjochen@chromium.org <jochen@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 8 Apr 2014 17:19:15 +0000 (17:19 +0000)
That's what the comment says should happen, and what Heap's ctor
expects.

BUG=none
LOG=n
R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/226113006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20583 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/platform-posix.cc

index 20c2533..d676d5d 100644 (file)
@@ -96,6 +96,7 @@ intptr_t OS::MaxVirtualMemory() {
   struct rlimit limit;
   int result = getrlimit(RLIMIT_DATA, &limit);
   if (result != 0) return 0;
+  if (limit.rlim_cur == RLIM_INFINITY) return 0;
   return limit.rlim_cur;
 }