| Index: src/defaults.cc
|
| diff --git a/src/defaults.cc b/src/defaults.cc
|
| index cbbe53729ebd171772106b589ae8b8c6fb4488d1..913d094ad59a2a6c97aed80ffa6f2f3a8959930b 100644
|
| --- a/src/defaults.cc
|
| +++ b/src/defaults.cc
|
| @@ -50,7 +50,15 @@ bool ConfigureResourceConstraintsForCurrentPlatform(
|
| return false;
|
| }
|
|
|
| - uint64_t physical_memory = i::OS::TotalPhysicalMemory();
|
| + uint64_t physical_memory;
|
| + i::Isolate* isolate = i::Isolate::UncheckedCurrent();
|
| + if (isolate != NULL &&
|
| + isolate->thread_local_top()->total_physical_memory_callback_ != NULL) {
|
| + physical_memory =
|
| + isolate->thread_local_top()->total_physical_memory_callback_();
|
| + } else {
|
| + physical_memory = i::OS::TotalPhysicalMemory();
|
| + }
|
| int lump_of_memory = (i::kPointerSize / 4) * i::MB;
|
|
|
| // The young_space_size should be a power of 2 and old_generation_size should
|
|
|