Index: include/v8.h |
diff --git a/include/v8.h b/include/v8.h |
index c56295ac78dd8a4c6561f97f12717e5972381520..ba0487b91519812b1ab1a979bac5760098b772a7 100644 |
--- a/include/v8.h |
+++ b/include/v8.h |
@@ -3973,6 +3973,15 @@ class V8_EXPORT Isolate { |
}; |
/** |
+ * Types of garbage collections that can be requested via |
+ * RequestGarbageCollectionForTesting. |
+ */ |
+ enum GarbageCollectionType { |
+ kFullGarbageCollection, |
+ kMinorGarbageCollection |
+ }; |
+ |
+ /** |
* Creates a new isolate. Does not change the currently entered |
* isolate. |
* |
@@ -4184,6 +4193,17 @@ class V8_EXPORT Isolate { |
*/ |
void ClearInterrupt(); |
+ /** |
+ * Request garbage collection in this Isolate. It is only valid to call this |
+ * function if --expose_gc was specified. |
+ * |
+ * This should only be used for testing purposes and not to enforce a garbage |
+ * collection schedule. It has strong negative impact on the garbage |
+ * collection performance. Use IdleNotification() or LowMemoryNotification() |
+ * instead to influence the garbage collection schedule. |
+ */ |
+ void RequestGarbageCollectionForTesting(GarbageCollectionType type); |
+ |
private: |
Isolate(); |
Isolate(const Isolate&); |