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

Unified Diff: src/heap/heap.h

Issue 1518803005: Reland of "[cctest] Add tests for aborting compaction of pages" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Sweep NEVER_ALLOCATE_ON_PAGE pages. Memory gets dropped in the free list again Created 5 years 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 | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index 8eeb04f0cd4b2ea868113a299498ed939143aca7..3919bdcc2c877f801bb33b36256d622b463cd751 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -817,6 +817,7 @@ class Heap {
// TODO(hpayer): There is still a missmatch between capacity and actual
// committed memory size.
bool CanExpandOldGeneration(int size) {
+ if (force_oom_) return false;
return (CommittedOldGenerationMemory() + size) < MaxOldGenerationSize();
}
@@ -2117,6 +2118,8 @@ class Heap {
MUST_USE_RESULT AllocationResult InternalizeString(String* str);
+ void set_force_oom(bool value) { force_oom_ = value; }
+
// The amount of external memory registered through the API kept alive
// by global handles
int64_t amount_of_external_allocated_memory_;
@@ -2365,6 +2368,9 @@ class Heap {
ArrayBufferTracker* array_buffer_tracker_;
+ // Used for testing purposes.
+ bool force_oom_;
+
// Classes in "heap" can be friends.
friend class AlwaysAllocateScope;
friend class GCCallbacksScope;
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698