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

Unified Diff: runtime/bin/dartutils.cc

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/dartutils.h ('k') | runtime/bin/io_buffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dartutils.cc
===================================================================
--- runtime/bin/dartutils.cc (revision 17875)
+++ runtime/bin/dartutils.cc (working copy)
@@ -664,10 +664,9 @@
}
-Dart_CObject* CObject::NewExternalUint8Array(int64_t length,
- uint8_t* data,
- void* peer,
- Dart_PeerFinalizer callback) {
+Dart_CObject* CObject::NewExternalUint8Array(
+ int64_t length, uint8_t* data, void* peer,
+ Dart_WeakPersistentHandleFinalizer callback) {
Dart_CObject* cobject = New(Dart_CObject::kExternalUint8Array);
cobject->value.as_external_byte_array.length = length;
cobject->value.as_external_byte_array.data = data;
@@ -679,14 +678,14 @@
Dart_CObject* CObject::NewIOBuffer(int64_t length) {
uint8_t* data = IOBuffer::Allocate(length);
- return NewExternalUint8Array(length, data, data, IOBuffer::Free);
+ return NewExternalUint8Array(length, data, data, IOBuffer::Finalizer);
}
void CObject::FreeIOBufferData(Dart_CObject* cobject) {
ASSERT(cobject->type == Dart_CObject::kExternalUint8Array);
cobject->value.as_external_byte_array.callback(
- cobject->value.as_external_byte_array.peer);
+ NULL, cobject->value.as_external_byte_array.peer);
cobject->value.as_external_byte_array.data = NULL;
}
« no previous file with comments | « runtime/bin/dartutils.h ('k') | runtime/bin/io_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698