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

Unified Diff: runtime/include/dart_api.h

Issue 10905251: Lazy peer API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | runtime/vm/dart_api_impl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/include/dart_api.h
diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h
index b70872a18ee38cfbab0f8b30260bdfccc3552be4..975eb6d81305ec45de1a41550e66c4e61d8fad14 100755
--- a/runtime/include/dart_api.h
+++ b/runtime/include/dart_api.h
@@ -2611,4 +2611,40 @@ DART_EXPORT void Dart_InitPerfEventsSupport(Dart_FileWriterFunction function);
// Support for generating flow graph compiler debugging output into a file.
DART_EXPORT void Dart_InitFlowGraphPrinting(Dart_FileWriterFunction function);
+// --- Peers ---
+
+/**
cshapiro 2012/09/15 01:23:41 I will add a comment here that peers are intended
+ * Every heap allocated object has a lazily allocated field known as
+ * its peer.
siva 2012/09/14 00:03:46 Do we really want to allow peer fields for every h
cshapiro 2012/09/15 01:23:41 I have limited this to types which are not subtype
+ */
+
+/**
+ * Returns the value of peer field in 'peer'. Sets 'peer' to NULL and
+ * returns an error if the peer field has not been allocated.
siva 2012/09/14 00:03:46 Why do you return an error if there is no peer fie
cshapiro 2012/09/15 01:23:41 I am confused. You can use second form. The alte
+ *
+ * \param object A heap allocated object.
+ * \param peer An out parameter that returns the value of the peer
+ * field.
+ *
+ * \return Success if 'object' is heap allocated and has its peer
+ * field allocated.
+ */
+DART_EXPORT Dart_Handle Dart_GetPeer(Dart_Handle object, void** peer);
+
+/**
+ * Sets or replaces the value in the peer field of 'object'. If
+ * 'peer' is NULL the peer field is deallocated.
siva 2012/09/14 00:03:46 I find the notion of deleting a peer field by call
cshapiro 2012/09/15 01:23:41 The peer field being deleted is an implementation
+ *
+ * \param object A heap allocated object.
+ * \param peer A value to store in the peer field.
+ *
+ * \return Success if 'object' is heap allocated.
+ */
+DART_EXPORT Dart_Handle Dart_SetPeer(Dart_Handle object, void* peer);
+
+/**
+ * Returns true if object has its peer field set.
+ */
+DART_EXPORT bool Dart_HasPeer(Dart_Handle object);
siva 2012/09/14 00:03:46 This call would not be needed if we go with the su
cshapiro 2012/09/15 01:23:41 It's gone. Done.
+
#endif // INCLUDE_DART_API_H_
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | runtime/vm/dart_api_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698