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

Unified Diff: runtime/include/dart_api.h

Issue 9605033: Implement a garbage collection prologue and epilogue callback mechanism. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix a comment Created 8 years, 9 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 | runtime/vm/dart_api_impl.cc » ('j') | runtime/vm/dart_api_impl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/include/dart_api.h
diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h
index 48b4a4718b2fd9a99b13f11fc5d30b86c7ede05a..3df6cbeb5fb1281d403448c4543c225845102480 100755
--- a/runtime/include/dart_api.h
+++ b/runtime/include/dart_api.h
@@ -272,6 +272,61 @@ DART_EXPORT Dart_Handle Dart_NewWeakReferenceSet(Dart_Handle* keys,
Dart_Handle* values,
intptr_t num_values);
+// --- Garbage Collection Callbacks --
turnidge 2012/03/07 00:25:16 Could add general comment here (see other sections
cshapiro 2012/03/07 03:06:10 Done.
+
+typedef void (*Dart_GcPrologueCallback)();
+typedef void (*Dart_GcEpilogueCallback)();
turnidge 2012/03/07 00:25:16 Comment these in a way similar to other function t
cshapiro 2012/03/07 03:06:10 Done.
+
+/**
+ * Adds a garbage collection prologue callback.
+ *
+ * \param callback A function pointer to a prologue callback function.
+ * This function must not have been previously added as a prologue
+ * callback.
+ *
+ * \return Success if the callback was added. Otherwise, returns an
+ * error handle.
+ */
+DART_EXPORT Dart_Handle Dart_NewGcPrologueCallback(
turnidge 2012/03/07 00:25:16 Consider s/New/add?
cshapiro 2012/03/07 03:06:10 I've make the switch. These are now the only add
+ Dart_GcPrologueCallback callback);
+
+/**
+ * Removes a garbage collection prologue callback.
+ *
+ * \param callback A function pointer to a prologue callback function.
+ * This function must have been added as a prologue callback.
+ *
+ * \return Success if the callback was removed. Otherwise, returns an
+ * error handle.
+ */
+DART_EXPORT Dart_Handle Dart_DeleteGcPrologueCallback(
turnidge 2012/03/07 00:25:16 s/Delete/Remove?
cshapiro 2012/03/07 03:06:10 See above.
+ Dart_GcPrologueCallback callback);
+
+/**
+ * Adds a garbage collection epilogue callback.
+ *
+ * \param callback A function pointer to an epilogue callback
+ * function. This function must not have been previously added as
+ * an epilogue callback.
+ *
+ * \return Success if the callback was added. Otherwise, returns an
+ * error handle.
+ */
+DART_EXPORT Dart_Handle Dart_NewGcEpilogueCallback(
+ Dart_GcEpilogueCallback callback);
+
+/**
+ * Removes a garbage collection epilogue callback.
+ *
+ * \param callback A function pointer to an epilogue callback
+ * function. This function must have been added as an epilogue
+ * callback.
+ *
+ * \return Success if the callback was removed. Otherwise, returns an
+ * error handle.
+ */
+DART_EXPORT Dart_Handle Dart_DeleteGcEpilogueCallback(
+ Dart_GcEpilogueCallback callback);
// --- Initialization and Globals ---
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | runtime/vm/dart_api_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698