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

Unified Diff: include/v8.h

Issue 2921883002: [heap] Lower external allocation limit when external memory shrinks. (Closed)
Patch Set: accounting Created 3 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 75da4dc7ea518c3e1a5740e3d444fbf11fa122c6..487573c30220809890d5b1d5ecc8a9ab7be6cfc7 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -10040,7 +10040,7 @@ int64_t Isolate::AdjustAmountOfExternalAllocatedMemory(
typedef internal::Internals I;
int64_t* external_memory = reinterpret_cast<int64_t*>(
reinterpret_cast<uint8_t*>(this) + I::kExternalMemoryOffset);
- const int64_t external_memory_limit = *reinterpret_cast<int64_t*>(
+ int64_t* external_memory_limit = reinterpret_cast<int64_t*>(
reinterpret_cast<uint8_t*>(this) + I::kExternalMemoryLimitOffset);
int64_t* external_memory_at_last_mc =
reinterpret_cast<int64_t*>(reinterpret_cast<uint8_t*>(this) +
@@ -10058,7 +10058,11 @@ int64_t Isolate::AdjustAmountOfExternalAllocatedMemory(
CheckMemoryPressure();
}
- if (change_in_bytes > 0 && amount > external_memory_limit) {
+ if (change_in_bytes < 0) {
+ *external_memory_limit += change_in_bytes;
+ }
+
+ if (change_in_bytes > 0 && amount > *external_memory_limit) {
ReportExternalAllocationLimitReached();
}
return *external_memory;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698