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

Side by Side 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, 2 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
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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 OS::Abort(); 224 OS::Abort();
225 } 225 }
226 void* addr = mmap(NULL, size, PROT_READ | PROT_EXEC, MAP_PRIVATE, 226 void* addr = mmap(NULL, size, PROT_READ | PROT_EXEC, MAP_PRIVATE,
227 fileno(f), 0); 227 fileno(f), 0);
228 ASSERT(addr != MAP_FAILED); 228 ASSERT(addr != MAP_FAILED);
229 OS::Free(addr, size); 229 OS::Free(addr, size);
230 fclose(f); 230 fclose(f);
231 } 231 }
232 232
233 233
234 uintptr_t OS::TotalPhysicalMemory(int pages_name) {
235 intptr_t pages = sysconf(pages_name);
236 intptr_t page_size = sysconf(_SC_PAGESIZE);
237 if (pages == -1 || page_size == -1) {
238 UNREACHABLE();
239 return 0;
240 }
241 return static_cast<uintptr_t>(pages) * page_size;
242 }
243
234 244
235 // Constants used for mmap. 245 // Constants used for mmap.
236 static const int kMmapFd = -1; 246 static const int kMmapFd = -1;
237 static const int kMmapFdOffset = 0; 247 static const int kMmapFdOffset = 0;
238 248
239 249
240 VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { } 250 VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { }
241 251
242 252
243 VirtualMemory::VirtualMemory(size_t size) 253 VirtualMemory::VirtualMemory(size_t size)
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 return munmap(base, size) == 0; 372 return munmap(base, size) == 0;
363 } 373 }
364 374
365 375
366 bool VirtualMemory::HasLazyCommits() { 376 bool VirtualMemory::HasLazyCommits() {
367 // TODO(alph): implement for the platform. 377 // TODO(alph): implement for the platform.
368 return false; 378 return false;
369 } 379 }
370 380
371 } } // namespace v8::internal 381 } } // namespace v8::internal
OLDNEW
« 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