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

Unified Diff: runtime/include/dart_api.h

Issue 12093071: - Change the layout of external typed array objects to avoid the extra indirection when accessing e… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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 | « runtime/bin/io_buffer.cc ('k') | runtime/lib/byte_array.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/include/dart_api.h
===================================================================
--- runtime/include/dart_api.h (revision 17875)
+++ runtime/include/dart_api.h (working copy)
@@ -958,7 +958,7 @@
int length;
uint8_t* data;
void* peer;
- Dart_PeerFinalizer callback;
+ Dart_WeakPersistentHandleFinalizer callback;
} as_external_byte_array;
} value;
} Dart_CObject;
@@ -1664,12 +1664,15 @@
* \param peer An external pointer to associate with this byte array.
*
* \return The ByteArray object if no error occurs. Otherwise returns
- * an error handle.
+ * an error handle. The ByteArray object is returned in a
+ * WeakPersistentHandle which needs to be deleted in the specified callback
+ * using Dart_DeletePersistentHandle.
*/
-DART_EXPORT Dart_Handle Dart_NewExternalByteArray(uint8_t* data,
- intptr_t length,
- void* peer,
- Dart_PeerFinalizer callback);
+DART_EXPORT Dart_Handle Dart_NewExternalByteArray(
+ uint8_t* data,
+ intptr_t length,
+ void* peer,
+ Dart_WeakPersistentHandleFinalizer callback);
/**
* Returns a clamped ByteArray which references an external array of
@@ -1683,13 +1686,15 @@
* \param peer An external pointer to associate with this byte array.
*
* \return The clamped ByteArray object if no error occurs. Otherwise returns
- * an error handle.
+ * an error handle. The clamped ByteArray object is returned in a
+ * WeakPersistentHandle which needs to be deleted in the specified callback
+ * using Dart_DeletePersistentHandle.
*/
DART_EXPORT Dart_Handle Dart_NewExternalClampedByteArray(
uint8_t* data,
intptr_t length,
void* peer,
- Dart_PeerFinalizer callback);
+ Dart_WeakPersistentHandleFinalizer callback);
/**
* Retrieves the data pointer associated with an external ByteArray.
« no previous file with comments | « runtime/bin/io_buffer.cc ('k') | runtime/lib/byte_array.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698