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

Side by Side Diff: runtime/vm/raw_object.h

Issue 11414211: Expose transferable constructor to Int8List (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Review fixes Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
« runtime/vm/os_test.cc ('K') | « runtime/vm/os_win.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_RAW_OBJECT_H_ 5 #ifndef VM_RAW_OBJECT_H_
6 #define VM_RAW_OBJECT_H_ 6 #define VM_RAW_OBJECT_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/token.h" 10 #include "vm/token.h"
(...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 RAW_HEAP_OBJECT_IMPLEMENTATION(Float64Array); 1340 RAW_HEAP_OBJECT_IMPLEMENTATION(Float64Array);
1341 1341
1342 // Variable length data follows here. 1342 // Variable length data follows here.
1343 double data_[0]; 1343 double data_[0];
1344 }; 1344 };
1345 1345
1346 1346
1347 template<typename T> 1347 template<typename T>
1348 class ExternalByteArrayData { 1348 class ExternalByteArrayData {
1349 public: 1349 public:
1350 static const int kAlignment = 16;
1351
1350 ExternalByteArrayData(T* data, 1352 ExternalByteArrayData(T* data,
1351 void* peer, 1353 void* peer,
1352 Dart_PeerFinalizer callback) : 1354 Dart_PeerFinalizer callback) :
1353 data_(data), peer_(peer), callback_(callback) { 1355 data_(data), peer_(peer), callback_(callback) {
1354 } 1356 }
1355 ~ExternalByteArrayData() { 1357 ~ExternalByteArrayData() {
1356 if (callback_ != NULL) (*callback_)(peer_); 1358 if (callback_ != NULL) (*callback_)(peer_);
1357 } 1359 }
1358 1360
1359 T* data() { 1361 T* data() {
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
1637 kExternalUint64ArrayCid == kExternalInt8ArrayCid + 7 && 1639 kExternalUint64ArrayCid == kExternalInt8ArrayCid + 7 &&
1638 kExternalFloat32ArrayCid == kExternalInt8ArrayCid + 8 && 1640 kExternalFloat32ArrayCid == kExternalInt8ArrayCid + 8 &&
1639 kExternalFloat64ArrayCid == kExternalInt8ArrayCid + 9 && 1641 kExternalFloat64ArrayCid == kExternalInt8ArrayCid + 9 &&
1640 kStacktraceCid == kExternalInt8ArrayCid + 10); 1642 kStacktraceCid == kExternalInt8ArrayCid + 10);
1641 return (index >= kExternalInt8ArrayCid && index <= kExternalFloat64ArrayCid); 1643 return (index >= kExternalInt8ArrayCid && index <= kExternalFloat64ArrayCid);
1642 } 1644 }
1643 1645
1644 } // namespace dart 1646 } // namespace dart
1645 1647
1646 #endif // VM_RAW_OBJECT_H_ 1648 #endif // VM_RAW_OBJECT_H_
OLDNEW
« runtime/vm/os_test.cc ('K') | « runtime/vm/os_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698