| 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 */ | 231 */ |
| 232 DART_EXPORT void Dart_DeletePersistentHandle(Dart_Handle object); | 232 DART_EXPORT void Dart_DeletePersistentHandle(Dart_Handle object); |
| 233 | 233 |
| 234 /** | 234 /** |
| 235 * Allocates a weak persistent handle for an object. | 235 * Allocates a weak persistent handle for an object. |
| 236 * | 236 * |
| 237 * This handle has the lifetime of the current isolate unless it is | 237 * This handle has the lifetime of the current isolate unless it is |
| 238 * explicitly deallocated by calling Dart_DeletePersistentHandle. | 238 * explicitly deallocated by calling Dart_DeletePersistentHandle. |
| 239 * | 239 * |
| 240 * Requires there to be a current isolate. | 240 * Requires there to be a current isolate. |
| 241 * |
| 242 * \param object An object. |
| 243 * \param peer A pointer to a native object or NULL. This value is |
| 244 * provided to callback when it is invoked. |
| 245 * \param callback A function pointer that will be invoked sometime |
| 246 * after the object is garbage collected. |
| 247 * |
| 248 * \return Success if the weak persistent handle was |
| 249 * created. Otherwise, returns an error. |
| 241 */ | 250 */ |
| 242 DART_EXPORT Dart_Handle Dart_NewWeakPersistentHandle( | 251 DART_EXPORT Dart_Handle Dart_NewWeakPersistentHandle( |
| 243 Dart_Handle object, | 252 Dart_Handle object, |
| 244 void* peer, | 253 void* peer, |
| 245 Dart_WeakPersistentHandleFinalizer callback); | 254 Dart_WeakPersistentHandleFinalizer callback); |
| 246 | 255 |
| 247 /** | 256 /** |
| 248 * Is this object a weak persistent handle? | 257 * Is this object a weak persistent handle? |
| 249 * | 258 * |
| 250 * Requires there to be a current isolate. | 259 * Requires there to be a current isolate. |
| 251 */ | 260 */ |
| 252 DART_EXPORT bool Dart_IsWeakPersistentHandle(Dart_Handle object); | 261 DART_EXPORT bool Dart_IsWeakPersistentHandle(Dart_Handle object); |
| 253 | 262 |
| 263 /** |
| 264 * Allocates a prologue weak persistent handle for an object. |
| 265 * |
| 266 * Prologue weak persistent handles are similar to weak persistent |
| 267 * handles but exhibit different behavior during garbage collections |
| 268 * that invoke the prologue and epilogue callbacks. While weak |
| 269 * persistent handles always weakly reference their referents, |
| 270 * prologue weak persistent handles weakly reference their referents |
| 271 * only during a garbage collection that invokes the prologue and |
| 272 * epilogue callbacks. During all other garbage collections, prologue |
| 273 * weak persistent handles strongly reference their referents. |
| 274 * |
| 275 * This handle has the lifetime of the current isolate unless it is |
| 276 * explicitly deallocated by calling Dart_DeletePersistentHandle. |
| 277 * |
| 278 * Requires there to be a current isolate. |
| 279 * |
| 280 * \param object An object. |
| 281 * \param peer A pointer to a native object or NULL. This value is |
| 282 * provided to callback when it is invoked. |
| 283 * \param callback A function pointer that will be invoked sometime |
| 284 * after the object is garbage collected. |
| 285 * |
| 286 * \return Success if the prologue weak persistent handle was created. |
| 287 * Otherwise, returns an error. |
| 288 */ |
| 289 DART_EXPORT Dart_Handle Dart_NewPrologueWeakPersistentHandle( |
| 290 Dart_Handle object, |
| 291 void* peer, |
| 292 Dart_WeakPersistentHandleFinalizer callback); |
| 293 |
| 294 /** |
| 295 * Is this object a prologue weak persistent handle? |
| 296 * |
| 297 * Requires there to be a current isolate. |
| 298 */ |
| 299 DART_EXPORT bool Dart_IsPrologueWeakPersistentHandle(Dart_Handle object); |
| 254 | 300 |
| 255 /** | 301 /** |
| 256 * Constructs a set of weak references from the Cartesian product of | 302 * Constructs a set of weak references from the Cartesian product of |
| 257 * the objects in the key set and the objects in values set. | 303 * the objects in the key set and the objects in values set. |
| 258 * | 304 * |
| 259 * \param keys A set of object references. These references will be | 305 * \param keys A set of object references. These references will be |
| 260 * considered weak by the garbage collector. | 306 * considered weak by the garbage collector. |
| 261 * \param num_keys the number of objects in the keys set. | 307 * \param num_keys the number of objects in the keys set. |
| 262 * \param values A set of object references. These references will be | 308 * \param values A set of object references. These references will be |
| 263 * considered weak by garbage collector unless any object reference | 309 * considered weak by garbage collector unless any object reference |
| (...skipping 1742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2006 | 2052 |
| 2007 // --- Profiling support ---- | 2053 // --- Profiling support ---- |
| 2008 | 2054 |
| 2009 // External pprof support for gathering and dumping symbolic | 2055 // External pprof support for gathering and dumping symbolic |
| 2010 // information that can be used for better profile reports for | 2056 // information that can be used for better profile reports for |
| 2011 // dynamically generated code. | 2057 // dynamically generated code. |
| 2012 DART_EXPORT void Dart_InitPprofSupport(); | 2058 DART_EXPORT void Dart_InitPprofSupport(); |
| 2013 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); | 2059 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); |
| 2014 | 2060 |
| 2015 #endif // INCLUDE_DART_API_H_ | 2061 #endif // INCLUDE_DART_API_H_ |
| OLD | NEW |