Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(565)

Side by Side Diff: src/platform-posix.cc

Issue 226113006: Return 0 as maximal amount of physical memory if there is no limit. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 } 89 }
90 90
91 91
92 // Maximum size of the virtual memory. 0 means there is no artificial 92 // Maximum size of the virtual memory. 0 means there is no artificial
93 // limit. 93 // limit.
94 94
95 intptr_t OS::MaxVirtualMemory() { 95 intptr_t OS::MaxVirtualMemory() {
96 struct rlimit limit; 96 struct rlimit limit;
97 int result = getrlimit(RLIMIT_DATA, &limit); 97 int result = getrlimit(RLIMIT_DATA, &limit);
98 if (result != 0) return 0; 98 if (result != 0) return 0;
99 if (limit.rlim_cur == RLIM_INFINITY) return 0;
99 return limit.rlim_cur; 100 return limit.rlim_cur;
100 } 101 }
101 102
102 103
103 uint64_t OS::TotalPhysicalMemory() { 104 uint64_t OS::TotalPhysicalMemory() {
104 #if V8_OS_MACOSX 105 #if V8_OS_MACOSX
105 int mib[2]; 106 int mib[2];
106 mib[0] = CTL_HW; 107 mib[0] = CTL_HW;
107 mib[1] = HW_MEMSIZE; 108 mib[1] = HW_MEMSIZE;
108 int64_t size = 0; 109 int64_t size = 0;
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 807
807 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { 808 void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
808 pthread_key_t pthread_key = LocalKeyToPthreadKey(key); 809 pthread_key_t pthread_key = LocalKeyToPthreadKey(key);
809 int result = pthread_setspecific(pthread_key, value); 810 int result = pthread_setspecific(pthread_key, value);
810 ASSERT_EQ(0, result); 811 ASSERT_EQ(0, result);
811 USE(result); 812 USE(result);
812 } 813 }
813 814
814 815
815 } } // namespace v8::internal 816 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698