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

Unified Diff: src/platform-freebsd.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-freebsd.cc
diff --git a/src/platform-freebsd.cc b/src/platform-freebsd.cc
index 518ad3185f01c026fcf358261b7ad3fb964b871f..9d86f1349c70af3f3356df76d4071ea91940e2e7 100644
--- a/src/platform-freebsd.cc
+++ b/src/platform-freebsd.cc
@@ -199,6 +199,18 @@ void OS::SignalCodeMovingGC() {
}
+uintptr_t OS::TotalPhysicalMemory() {
+ int pages, page_size;
+ size_t size = sizeof(pages);
+ sysctlbyname("vm.stats.vm.v_page_count", &pages, &size, NULL, 0);
+ sysctlbyname("vm.stats.vm.v_page_size", &page_size, &size, NULL, 0);
+ 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-cygwin.cc ('k') | src/platform-linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698