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

Side by Side 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: address review comments 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | runtime/vm/gc_callbacks.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef INCLUDE_DART_API_H_ 5 #ifndef INCLUDE_DART_API_H_
6 #define INCLUDE_DART_API_H_ 6 #define INCLUDE_DART_API_H_
7 7
8 /** \mainpage Dart Embedding API Reference 8 /** \mainpage Dart Embedding API Reference
9 * 9 *
10 * Dart is a class-based programming language for creating structured 10 * Dart is a class-based programming language for creating structured
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 * \param num_values the size of the values set 265 * \param num_values the size of the values set
266 * 266 *
267 * \return Success if the weak reference set could be created. 267 * \return Success if the weak reference set could be created.
268 * Otherwise, returns an error handle. 268 * Otherwise, returns an error handle.
269 */ 269 */
270 DART_EXPORT Dart_Handle Dart_NewWeakReferenceSet(Dart_Handle* keys, 270 DART_EXPORT Dart_Handle Dart_NewWeakReferenceSet(Dart_Handle* keys,
271 intptr_t num_keys, 271 intptr_t num_keys,
272 Dart_Handle* values, 272 Dart_Handle* values,
273 intptr_t num_values); 273 intptr_t num_values);
274 274
275 // --- Garbage Collection Callbacks --
276
277 /**
278 * Callbacks signal the beginning and end of a garbage collection.
279 *
280 * These signals are intended to be used by the embedder to manage the
281 * lifetime of native objects with a managed object peer.
282 */
283
284 /**
285 * A callback invoked at the beginning of a garbage collection.
286 */
287 typedef void (*Dart_GcPrologueCallback)();
288
289 /**
290 * A callback invoked at the end of a garbage collection.
291 */
292 typedef void (*Dart_GcEpilogueCallback)();
293
294 /**
295 * Adds a garbage collection prologue callback.
296 *
297 * \param callback A function pointer to a prologue callback function.
298 * This function must not have been previously added as a prologue
299 * callback.
300 *
301 * \return Success if the callback was added. Otherwise, returns an
302 * error handle.
303 */
304 DART_EXPORT Dart_Handle Dart_AddGcPrologueCallback(
305 Dart_GcPrologueCallback callback);
306
307 /**
308 * Removes a garbage collection prologue callback.
309 *
310 * \param callback A function pointer to a prologue callback function.
311 * This function must have been added as a prologue callback.
312 *
313 * \return Success if the callback was removed. Otherwise, returns an
314 * error handle.
315 */
316 DART_EXPORT Dart_Handle Dart_RemoveGcPrologueCallback(
317 Dart_GcPrologueCallback callback);
318
319 /**
320 * Adds a garbage collection epilogue callback.
321 *
322 * \param callback A function pointer to an epilogue callback
323 * function. This function must not have been previously added as
324 * an epilogue callback.
325 *
326 * \return Success if the callback was added. Otherwise, returns an
327 * error handle.
328 */
329 DART_EXPORT Dart_Handle Dart_AddGcEpilogueCallback(
330 Dart_GcEpilogueCallback callback);
331
332 /**
333 * Removes a garbage collection epilogue callback.
334 *
335 * \param callback A function pointer to an epilogue callback
336 * function. This function must have been added as an epilogue
337 * callback.
338 *
339 * \return Success if the callback was removed. Otherwise, returns an
340 * error handle.
341 */
342 DART_EXPORT Dart_Handle Dart_RemoveGcEpilogueCallback(
343 Dart_GcEpilogueCallback callback);
275 344
276 // --- Initialization and Globals --- 345 // --- Initialization and Globals ---
277 346
278 /** 347 /**
279 * An isolate creation and initialization callback function. 348 * An isolate creation and initialization callback function.
280 * 349 *
281 * This callback, provided by the embedder, is called when an isolate needs 350 * This callback, provided by the embedder, is called when an isolate needs
282 * to be created. The callback should create an isolate and load the 351 * to be created. The callback should create an isolate and load the
283 * required scripts for execution. 352 * required scripts for execution.
284 * 353 *
(...skipping 1565 matching lines...) Expand 10 before | Expand all | Expand 10 after
1850 1919
1851 // --- Profiling support ---- 1920 // --- Profiling support ----
1852 1921
1853 // External pprof support for gathering and dumping symbolic 1922 // External pprof support for gathering and dumping symbolic
1854 // information that can be used for better profile reports for 1923 // information that can be used for better profile reports for
1855 // dynamically generated code. 1924 // dynamically generated code.
1856 DART_EXPORT void Dart_InitPprofSupport(); 1925 DART_EXPORT void Dart_InitPprofSupport();
1857 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); 1926 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size);
1858 1927
1859 #endif // INCLUDE_DART_API_H_ 1928 #endif // INCLUDE_DART_API_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | runtime/vm/gc_callbacks.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698