diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-11-20 00:04:22 -0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-11-20 00:04:22 -0800 |
commit | 56074d1056a4e4b7a9954f18805605d79b0a5c3a (patch) | |
tree | b409bbaaf9873703f87903f78a36279830458be1 /src/node_buffer.h | |
parent | a93634007a0c5366d415782c2a1f164a6d7ecbc5 (diff) | |
download | node-new-56074d1056a4e4b7a9954f18805605d79b0a5c3a.tar.gz |
Inline Buffer::Length and Buffer::Data
Diffstat (limited to 'src/node_buffer.h')
-rw-r--r-- | src/node_buffer.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/node_buffer.h b/src/node_buffer.h index 34b353d799..fa39b1e41b 100644 --- a/src/node_buffer.h +++ b/src/node_buffer.h @@ -36,8 +36,13 @@ class Buffer : public ObjectWrap { free_callback callback, void *hint); // public constructor static bool HasInstance(v8::Handle<v8::Value> val); - static char* Data(v8::Handle<v8::Object>); - static size_t Length(v8::Handle<v8::Object>); + static inline char* Data(v8::Handle<v8::Object> obj) { + return (char*)obj->GetIndexedPropertiesExternalArrayData(); + } + + static inline size_t Length(v8::Handle<v8::Object> obj) { + return (size_t)obj->GetIndexedPropertiesExternalArrayDataLength(); + } private: static v8::Persistent<v8::FunctionTemplate> constructor_template; |