Always adjust amount of external memory when change is reported.
BUG= Review URL: https://codereview.chromium.org/866413002 Cr-Commit-Position: refs/heads/master@{#26247}
This commit is contained in:
parent
8c58ed1a0c
commit
a18fdd61dc
@ -7289,9 +7289,8 @@ int64_t Isolate::AdjustAmountOfExternalAllocatedMemory(
|
||||
amount - *amount_of_external_allocated_memory_at_last_global_gc >
|
||||
I::kExternalAllocationLimit) {
|
||||
CollectAllGarbage("external memory allocation limit reached.");
|
||||
} else {
|
||||
*amount_of_external_allocated_memory = amount;
|
||||
}
|
||||
*amount_of_external_allocated_memory = amount;
|
||||
return *amount_of_external_allocated_memory;
|
||||
}
|
||||
|
||||
|
@ -15199,6 +15199,12 @@ THREADED_TEST(ExternalAllocatedMemory) {
|
||||
isolate->AdjustAmountOfExternalAllocatedMemory(kSize));
|
||||
CHECK_EQ(baseline,
|
||||
isolate->AdjustAmountOfExternalAllocatedMemory(-kSize));
|
||||
const int64_t kTriggerGCSize =
|
||||
v8::internal::Internals::kExternalAllocationLimit + 1;
|
||||
CHECK_EQ(baseline + kTriggerGCSize,
|
||||
isolate->AdjustAmountOfExternalAllocatedMemory(kTriggerGCSize));
|
||||
CHECK_EQ(baseline,
|
||||
isolate->AdjustAmountOfExternalAllocatedMemory(-kTriggerGCSize));
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user