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

Unified Diff: runtime/vm/object.h

Issue 8775039: Add Dart_IsExternalString and Dart_ExternalStringGetPeer to the dart (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 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
« runtime/vm/dart_api_impl_test.cc ('K') | « runtime/vm/dart_api_impl_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
===================================================================
--- runtime/vm/object.h (revision 1990)
+++ runtime/vm/object.h (working copy)
@@ -2463,6 +2463,12 @@
bool IsSymbol() const;
+ virtual bool IsExternal() const { return false; }
+ virtual void* GetPeer() const {
+ UNREACHABLE();
+ return NULL;
+ }
+
static RawString* New(const char* str, Heap::Space space = Heap::kNew);
static RawString* New(const uint8_t* characters,
intptr_t len,
@@ -2743,6 +2749,11 @@
return RoundedAllocationSize(sizeof(RawExternalOneByteString));
}
+ virtual bool IsExternal() const { return true; }
+ virtual void* GetPeer() const {
+ return raw_ptr()->external_data_->peer_;
siva 2011/12/02 01:53:01 Not sure what the official C++ style guide says bu
turnidge 2011/12/05 17:54:28 Done.
+ }
+
static RawExternalOneByteString* New(const uint8_t* characters,
intptr_t len,
void* peer,
@@ -2780,6 +2791,11 @@
return RoundedAllocationSize(sizeof(RawExternalTwoByteString));
}
+ virtual bool IsExternal() const { return true; }
+ virtual void* GetPeer() const {
+ return raw_ptr()->external_data_->peer_;
+ }
+
static RawExternalTwoByteString* New(const uint16_t* characters,
intptr_t len,
void* peer,
@@ -2817,6 +2833,11 @@
return RoundedAllocationSize(sizeof(RawExternalFourByteString));
}
+ virtual bool IsExternal() const { return true; }
+ virtual void* GetPeer() const {
+ return raw_ptr()->external_data_->peer_;
+ }
+
static RawExternalFourByteString* New(const uint32_t* characters,
intptr_t len,
void* peer,
« runtime/vm/dart_api_impl_test.cc ('K') | « runtime/vm/dart_api_impl_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698