Reviewers: Hannes Payer,

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

BUG=none
[email protected]
LOG=n

Please review this at https://codereview.chromium.org/1201993002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+5, -5 lines):
  M include/v8.h
  M src/api.cc


Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index b06b9e0e1a722de4e2dfd36e7b22c845d2163c65..0caec4317268448d4f87ba85537dd78b5ad29ade 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -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;
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 560dc34b3004860c59c24f2c60e10c0bef7ce342..4b0ec63629a98b573c4a12b01fea2558dcdf641e 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -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);
 }




--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to