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

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: rebased 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 1c2ddc6d908b13de0b5113415c33e72b796845a6..bf087c35454d0d834ebf7396516c8b425e77a0db 100755
--- a/runtime/include/dart_api.h
+++ b/runtime/include/dart_api.h
@@ -2729,4 +2729,37 @@ 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 ---
+
+/**
+ * The peer field is a lazily allocated field intendend for storage of
+ * an uncommonly used values. Most instances types can have a peer
+ * field allocated. The exceptions are subtypes of Null, num, and
+ * bool.
+ */
+
+/**
+ * Returns the value of peer field of 'object' in 'peer'.
+ *
+ * \param object An object.
+ * \param peer An out parameter that returns the value of the peer
+ * field.
+ *
+ * \return Returns an error if 'object' is a subtype of Null, num, or
+ * bool.
+ */
+DART_EXPORT Dart_Handle Dart_GetPeer(Dart_Handle object, void** peer);
+
+/**
+ * Sets the value of the peer field of 'object' to the value of
+ * 'peer'.
+ *
+ * \param object An object.
+ * \param peer A value to store in the peer field.
+ *
+ * \return Returns an error if 'object' is a subtype of Null, num, or
+ * bool.
+ */
+DART_EXPORT Dart_Handle Dart_SetPeer(Dart_Handle object, void* peer);
+
#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