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

Side by Side Diff: runtime/include/dart_api.h

Issue 9655011: Implement prologue weak persistent handles. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: final revision 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.h » ('j') | no next file with comments »
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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698