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

Unified Diff: src/platform-openbsd.cc

Issue 24269003: Add methods to enable configuration of ResourceConstraints based on limits derived at runtime. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Move device-specific defaults into ConfigureResourceConstraintsForCurrentPlatform Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: src/platform-openbsd.cc
diff --git a/src/platform-openbsd.cc b/src/platform-openbsd.cc
index 4f5420ee45c97e5ede7ee0cde34118f1aac7c947..0b6c2bce7b00fe3e233cafede45b924b87cc483c 100644
--- a/src/platform-openbsd.cc
+++ b/src/platform-openbsd.cc
@@ -231,6 +231,16 @@ void OS::SignalCodeMovingGC() {
}
+uintptr_t OS::TotalPhysicalMemory(int pages_name) {
+ intptr_t pages = sysconf(pages_name);
+ intptr_t page_size = sysconf(_SC_PAGESIZE);
+ if (pages == -1 || page_size == -1) {
+ UNREACHABLE();
+ return 0;
+ }
+ return static_cast<uintptr_t>(pages) * page_size;
+}
+
// Constants used for mmap.
static const int kMmapFd = -1;
« src/heap.cc ('K') | « src/platform-macos.cc ('k') | src/platform-solaris.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698