Let GC select the collector when the external memory allocation limit is reached

BUG=none
R=hpayer@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/1201993002

Cr-Commit-Position: refs/heads/master@{#29235}
This commit is contained in:
jochen 2015-06-23 08:02:06 -07:00 committed by Commit bot
parent b76cf1f802
commit 93d6216099
2 changed files with 5 additions and 5 deletions

View File

@ -5923,7 +5923,7 @@ class V8_EXPORT Isolate {
void SetObjectGroupId(internal::Object** object, UniqueId id);
void SetReferenceFromGroup(UniqueId id, internal::Object** object);
void SetReference(internal::Object** parent, internal::Object** child);
void CollectAllGarbage(const char* gc_reason);
void CollectGarbage(const char* gc_reason);
};
class V8_EXPORT StartupData {
@ -8163,7 +8163,7 @@ int64_t Isolate::AdjustAmountOfExternalAllocatedMemory(
if (change_in_bytes > 0 &&
amount - *amount_of_external_allocated_memory_at_last_global_gc >
I::kExternalAllocationLimit) {
CollectAllGarbage("external memory allocation limit reached.");
CollectGarbage("external memory allocation limit reached.");
}
*amount_of_external_allocated_memory = amount;
return *amount_of_external_allocated_memory;

View File

@ -6866,9 +6866,9 @@ Local<Integer> v8::Integer::NewFromUnsigned(Isolate* isolate, uint32_t value) {
}
void Isolate::CollectAllGarbage(const char* gc_reason) {
reinterpret_cast<i::Isolate*>(this)->heap()->CollectAllGarbage(
i::Heap::kNoGCFlags, gc_reason);
void Isolate::CollectGarbage(const char* gc_reason) {
reinterpret_cast<i::Isolate*>(this)->heap()->CollectGarbage(i::NEW_SPACE,
gc_reason);
}