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

Unified Diff: src/heap/heap.h

Issue 2339033005: Revert of [heap] Decouple old generation allocation limit from external memory. (Closed)
Patch Set: Created 4 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 | « no previous file | src/heap/heap-inl.h » ('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 624744f7ee02e495a9fb8ea281005cce0765911b..101c25fd180b3fc68ebb6f8b09e381070464c3d1 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -1352,6 +1352,16 @@
survived_since_last_expansion_ += survived;
}
+ inline intptr_t PromotedTotalSize() {
+ int64_t total = PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize();
+ if (total > std::numeric_limits<intptr_t>::max()) {
+ // TODO(erikcorry): Use uintptr_t everywhere we do heap size calculations.
+ return std::numeric_limits<intptr_t>::max();
+ }
+ if (total < 0) return 0;
+ return static_cast<intptr_t>(total);
+ }
+
inline void UpdateNewSpaceAllocationCounter();
inline size_t NewSpaceAllocationCounter();
@@ -1794,7 +1804,7 @@
// ===========================================================================
inline intptr_t OldGenerationSpaceAvailable() {
- return old_generation_allocation_limit_ - PromotedSpaceSizeOfObjects();
+ return old_generation_allocation_limit_ - PromotedTotalSize();
}
// Returns maximum GC pause.
« no previous file with comments | « no previous file | src/heap/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698