| OLD | NEW |
| 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 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 * \param num_values the size of the values set | 444 * \param num_values the size of the values set |
| 445 * | 445 * |
| 446 * \return Success if the weak reference set could be created. | 446 * \return Success if the weak reference set could be created. |
| 447 * Otherwise, returns an error handle. | 447 * Otherwise, returns an error handle. |
| 448 */ | 448 */ |
| 449 DART_EXPORT Dart_Handle Dart_NewWeakReferenceSet(Dart_Handle* keys, | 449 DART_EXPORT Dart_Handle Dart_NewWeakReferenceSet(Dart_Handle* keys, |
| 450 intptr_t num_keys, | 450 intptr_t num_keys, |
| 451 Dart_Handle* values, | 451 Dart_Handle* values, |
| 452 intptr_t num_values); | 452 intptr_t num_values); |
| 453 | 453 |
| 454 // --- Garbage Collection Callbacks -- | 454 // --- Garbage Collection Callbacks --- |
| 455 | 455 |
| 456 /** | 456 /** |
| 457 * Callbacks signal the beginning and end of a garbage collection. | 457 * Callbacks signal the beginning and end of a garbage collection. |
| 458 * | 458 * |
| 459 * These signals are intended to be used by the embedder to manage the | 459 * These signals are intended to be used by the embedder to manage the |
| 460 * lifetime of native objects with a managed object peer. | 460 * lifetime of native objects with a managed object peer. |
| 461 */ | 461 */ |
| 462 | 462 |
| 463 /** | 463 /** |
| 464 * A callback invoked at the beginning of a garbage collection. | 464 * A callback invoked at the beginning of a garbage collection. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 * \param callback A function pointer to an epilogue callback | 514 * \param callback A function pointer to an epilogue callback |
| 515 * function. This function must have been added as an epilogue | 515 * function. This function must have been added as an epilogue |
| 516 * callback. | 516 * callback. |
| 517 * | 517 * |
| 518 * \return Success if the callback was removed. Otherwise, returns an | 518 * \return Success if the callback was removed. Otherwise, returns an |
| 519 * error handle. | 519 * error handle. |
| 520 */ | 520 */ |
| 521 DART_EXPORT Dart_Handle Dart_RemoveGcEpilogueCallback( | 521 DART_EXPORT Dart_Handle Dart_RemoveGcEpilogueCallback( |
| 522 Dart_GcEpilogueCallback callback); | 522 Dart_GcEpilogueCallback callback); |
| 523 | 523 |
| 524 // --- Heap Profiler --- |
| 525 |
| 526 /** |
| 527 * A callback invoked by the heap profiler during profiling to write |
| 528 * data. |
| 529 */ |
| 530 typedef void (*Dart_HeapProfileWriteCallback)(const void* data, |
| 531 intptr_t length, |
| 532 void* stream); |
| 533 |
| 534 /** |
| 535 * Generates a heap profile. |
| 536 * |
| 537 * \param callback A function pointer that will be repeatedly invoked |
| 538 * with heap profile data. |
| 539 * \param stream A pointer that will be passed to the callback. This |
| 540 * is a convenient way to provide an open stream to the callback. |
| 541 * |
| 542 * \return Success if the heap profile is successful. |
| 543 */ |
| 544 DART_EXPORT Dart_Handle Dart_HeapProfile(Dart_HeapProfileWriteCallback callback, |
| 545 void* stream); |
| 546 |
| 524 // --- Initialization and Globals --- | 547 // --- Initialization and Globals --- |
| 525 | 548 |
| 526 /** | 549 /** |
| 527 * An isolate creation and initialization callback function. | 550 * An isolate creation and initialization callback function. |
| 528 * | 551 * |
| 529 * This callback, provided by the embedder, is called when the vm | 552 * This callback, provided by the embedder, is called when the vm |
| 530 * needs to create an isolate. The callback should create an isolate | 553 * needs to create an isolate. The callback should create an isolate |
| 531 * by calling Dart_CreateIsolate and load any scripts required for | 554 * by calling Dart_CreateIsolate and load any scripts required for |
| 532 * execution. | 555 * execution. |
| 533 * | 556 * |
| (...skipping 1814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2348 // information that can be used for better profile reports for | 2371 // information that can be used for better profile reports for |
| 2349 // dynamically generated code. | 2372 // dynamically generated code. |
| 2350 DART_EXPORT void Dart_InitPprofSupport(); | 2373 DART_EXPORT void Dart_InitPprofSupport(); |
| 2351 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); | 2374 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); |
| 2352 | 2375 |
| 2353 // Support for generating flow graph compiler debugging output into a file. | 2376 // Support for generating flow graph compiler debugging output into a file. |
| 2354 typedef void (*FileWriterFunction)(const char* buffer, int64_t num_bytes); | 2377 typedef void (*FileWriterFunction)(const char* buffer, int64_t num_bytes); |
| 2355 DART_EXPORT void Dart_InitFlowGraphPrinting(FileWriterFunction function); | 2378 DART_EXPORT void Dart_InitFlowGraphPrinting(FileWriterFunction function); |
| 2356 | 2379 |
| 2357 #endif // INCLUDE_DART_API_H_ | 2380 #endif // INCLUDE_DART_API_H_ |
| OLD | NEW |