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

Unified Diff: src/api.cc

Issue 23464022: Add a ResourceConstraint for the embedder to specify that V8 is running on a memory constrained dev… (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: 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
« no previous file with comments | « include/v8.h ('k') | src/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 1bc80d27d1d7761ad7b010a5749ffa804592b519..7c145585986205969eb073bd1c895675f5012529 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -624,7 +624,8 @@ ResourceConstraints::ResourceConstraints()
: max_young_space_size_(0),
max_old_space_size_(0),
max_executable_size_(0),
- stack_limit_(NULL) { }
+ stack_limit_(NULL),
+ is_memory_constrained_() { }
bool SetResourceConstraints(ResourceConstraints* constraints) {
@@ -645,6 +646,10 @@ bool SetResourceConstraints(ResourceConstraints* constraints) {
uintptr_t limit = reinterpret_cast<uintptr_t>(constraints->stack_limit());
isolate->stack_guard()->SetStackLimit(limit);
}
+ if (constraints->is_memory_constrained().has_value) {
+ isolate->set_is_memory_constrained(
+ constraints->is_memory_constrained().value);
+ }
return true;
}
« no previous file with comments | « include/v8.h ('k') | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698