Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 0c978516675fbe46b349cb50da8e15b722dc25c7..4a526f595a7db0e0621c3548048c0d15ad8d8ddb 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -465,11 +465,12 @@ void ResourceConstraints::ConfigureDefaults(uint64_t physical_memory, |
set_max_available_threads(i::Max(i::Min(number_of_processors, 4u), 1u)); |
- if (virtual_memory_limit > 0 && i::kIs64BitArch) { |
+ if (virtual_memory_limit > 0 && i::kRequiresCodeRange) { |
// Reserve no more than 1/8 of the memory for the code range, but at most |
- // 512 MB. |
+ // kMaximalCodeRangeSize. |
set_code_range_size( |
- i::Min(512, static_cast<int>((virtual_memory_limit >> 3) / i::MB))); |
+ i::Min(i::kMaximalCodeRangeSize / i::MB, |
+ static_cast<size_t>((virtual_memory_limit >> 3) / i::MB))); |
} |
} |
@@ -480,7 +481,7 @@ bool SetResourceConstraints(Isolate* v8_isolate, |
int semi_space_size = constraints->max_semi_space_size(); |
int old_space_size = constraints->max_old_space_size(); |
int max_executable_size = constraints->max_executable_size(); |
- int code_range_size = constraints->code_range_size(); |
+ size_t code_range_size = constraints->code_range_size(); |
if (semi_space_size != 0 || old_space_size != 0 || |
max_executable_size != 0 || code_range_size != 0) { |
// After initialization it's too late to change Heap constraints. |