| Index: runtime/include/dart_api.h
|
| diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h
|
| index 48b4a4718b2fd9a99b13f11fc5d30b86c7ede05a..786a3515024efabe2c958df84cb5a39277dfe8c3 100755
|
| --- a/runtime/include/dart_api.h
|
| +++ b/runtime/include/dart_api.h
|
| @@ -272,6 +272,75 @@ DART_EXPORT Dart_Handle Dart_NewWeakReferenceSet(Dart_Handle* keys,
|
| Dart_Handle* values,
|
| intptr_t num_values);
|
|
|
| +// --- Garbage Collection Callbacks --
|
| +
|
| +/**
|
| + * Callbacks signal the beginning and end of a garbage collection.
|
| + *
|
| + * These signals are intended to be used by the embedder to manage the
|
| + * lifetime of native objects with a managed object peer.
|
| + */
|
| +
|
| +/**
|
| + * A callback invoked at the beginning of a garbage collection.
|
| + */
|
| +typedef void (*Dart_GcPrologueCallback)();
|
| +
|
| +/**
|
| + * A callback invoked at the end of a garbage collection.
|
| + */
|
| +typedef void (*Dart_GcEpilogueCallback)();
|
| +
|
| +/**
|
| + * 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_AddGcPrologueCallback(
|
| + 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_RemoveGcPrologueCallback(
|
| + 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_AddGcEpilogueCallback(
|
| + 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_RemoveGcEpilogueCallback(
|
| + Dart_GcEpilogueCallback callback);
|
|
|
| // --- Initialization and Globals ---
|
|
|
|
|