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

Unified Diff: include/dart_api.h

Issue 11360114: - Add functionality to morph a string into an external string (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 1 month 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 | vm/dart_api_impl.cc » ('j') | vm/object.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/dart_api.h
===================================================================
--- include/dart_api.h (revision 14937)
+++ include/dart_api.h (working copy)
@@ -1484,7 +1484,37 @@
uint16_t* utf16_array,
intptr_t* length);
+/**
+ * Gets the storage size in bytes of a String.
+ *
+ * \param str A String.
+ * \param length Returns the storage size in bytes of the String.
+ *
+ * \return A valid handle if no error occurs during the operation.
+ */
+DART_EXPORT Dart_Handle Dart_StringStorageSize(Dart_Handle str, intptr_t* size);
Ivan Posva 2012/11/15 06:17:15 I read the description and it is not clear to me w
siva 2012/11/15 21:34:13 Added comments to both Dart_StringStorageSize and
+
+/**
+ * Converts a String into an ExternalString.
+ * The original object is morphed into an external string object.
+ *
+ * \param array External space into which the string data will be
+ * copied into. This must not move.
+ * \param length The size in bytes of the provided external space (array).
+ * \param peer An external pointer to associate with this string.
+ * \param cback A callback to be called when this string is finalized.
+ *
+ * \return the converted ExternalString object if no error occurs.
+ * Otherwise returns an error handle.
+ */
+DART_EXPORT Dart_Handle Dart_MakeExternalString(Dart_Handle str,
+ void* array,
+ intptr_t length,
+ void* peer,
+ Dart_PeerFinalizer cback);
+
+
// --- Lists ---
/**
« no previous file with comments | « no previous file | vm/dart_api_impl.cc » ('j') | vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698