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

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: os.h fix 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.h ('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 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after
1338 RAW_HEAP_OBJECT_IMPLEMENTATION(Float64Array); 1338 RAW_HEAP_OBJECT_IMPLEMENTATION(Float64Array);
1339 1339
1340 // Variable length data follows here. 1340 // Variable length data follows here.
1341 double data_[0]; 1341 double data_[0];
1342 }; 1342 };
1343 1343
1344 1344
1345 template<typename T> 1345 template<typename T>
1346 class ExternalByteArrayData { 1346 class ExternalByteArrayData {
1347 public: 1347 public:
1348 static const int kAlignment = 16;
1349
1348 ExternalByteArrayData(T* data, 1350 ExternalByteArrayData(T* data,
1349 void* peer, 1351 void* peer,
1350 Dart_PeerFinalizer callback) : 1352 Dart_PeerFinalizer callback) :
1351 data_(data), peer_(peer), callback_(callback) { 1353 data_(data), peer_(peer), callback_(callback) {
1352 } 1354 }
1353 ~ExternalByteArrayData() { 1355 ~ExternalByteArrayData() {
1354 if (callback_ != NULL) (*callback_)(peer_); 1356 if (callback_ != NULL) (*callback_)(peer_);
1355 } 1357 }
1356 1358
1357 T* data() { 1359 T* data() {
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
1635 kExternalUint64ArrayCid == kExternalInt8ArrayCid + 7 && 1637 kExternalUint64ArrayCid == kExternalInt8ArrayCid + 7 &&
1636 kExternalFloat32ArrayCid == kExternalInt8ArrayCid + 8 && 1638 kExternalFloat32ArrayCid == kExternalInt8ArrayCid + 8 &&
1637 kExternalFloat64ArrayCid == kExternalInt8ArrayCid + 9 && 1639 kExternalFloat64ArrayCid == kExternalInt8ArrayCid + 9 &&
1638 kStacktraceCid == kExternalInt8ArrayCid + 10); 1640 kStacktraceCid == kExternalInt8ArrayCid + 10);
1639 return (index >= kExternalInt8ArrayCid && index <= kExternalFloat64ArrayCid); 1641 return (index >= kExternalInt8ArrayCid && index <= kExternalFloat64ArrayCid);
1640 } 1642 }
1641 1643
1642 } // namespace dart 1644 } // namespace dart
1643 1645
1644 #endif // VM_RAW_OBJECT_H_ 1646 #endif // VM_RAW_OBJECT_H_
OLDNEW
« runtime/vm/os.h ('K') | « runtime/vm/os_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698