Browse Source

deps: backport a02d97e from v8 upstream

Original commit message:

  Fix --max_old_space_size=4096 integer overflow.

  BUG=v8:3857
  LOG=N

  Review URL: https://codereview.chromium.org/897543002

  Cr-Commit-Position: refs/heads/master@{#26510}

PR-URL: https://github.com/joyent/node/pull/9200
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
v0.12.2-release
Andrei Sedoi 10 years ago
committed by Trevor Norris
parent
commit
2fc5eeb3da
  1. 9
      deps/v8/src/heap/heap.cc

9
deps/v8/src/heap/heap.cc

@ -4828,10 +4828,10 @@ bool Heap::ConfigureHeap(int max_semi_space_size, int max_old_space_size,
max_semi_space_size_ = max_semi_space_size * MB;
}
if (max_old_space_size > 0) {
max_old_generation_size_ = max_old_space_size * MB;
max_old_generation_size_ = static_cast<intptr_t>(max_old_space_size) * MB;
}
if (max_executable_size > 0) {
max_executable_size_ = max_executable_size * MB;
max_executable_size_ = static_cast<intptr_t>(max_executable_size) * MB;
}
// If max space size flags are specified overwrite the configuration.
@ -4839,10 +4839,11 @@ bool Heap::ConfigureHeap(int max_semi_space_size, int max_old_space_size,
max_semi_space_size_ = FLAG_max_semi_space_size * MB;
}
if (FLAG_max_old_space_size > 0) {
max_old_generation_size_ = FLAG_max_old_space_size * MB;
max_old_generation_size_ =
static_cast<intptr_t>(FLAG_max_old_space_size) * MB;
}
if (FLAG_max_executable_size > 0) {
max_executable_size_ = FLAG_max_executable_size * MB;
max_executable_size_ = static_cast<intptr_t>(FLAG_max_executable_size) * MB;
}
if (FLAG_stress_compaction) {

Loading…
Cancel
Save