diff options
author | Trevor Norris <trev.norris@gmail.com> | 2015-05-26 12:42:14 -0600 |
---|---|---|
committer | Rod Vagg <rod@vagg.org> | 2015-08-04 11:56:10 -0700 |
commit | 63da0dfd3a4460e117240e84b57af2137469497e (patch) | |
tree | 4806693f7d89ba36ebbe4ff1ab5f34e1b3cf90ea /src/node_buffer.h | |
parent | 23be6ca189e1ebad24a814ed1c8c1c241fee354e (diff) | |
download | android-node-v8-63da0dfd3a4460e117240e84b57af2137469497e.tar.gz android-node-v8-63da0dfd3a4460e117240e84b57af2137469497e.tar.bz2 android-node-v8-63da0dfd3a4460e117240e84b57af2137469497e.zip |
buffer: implement Uint8Array backed Buffer
With V8 4.4 removing the external array data API currently used by
Buffer, the new implementation uses the Uint8Array to back Buffer.
Buffers now have a maximum size of Smi::kMaxLength, as defined by V8.
Which is ~2 GB on 64 bit and ~1 GB on 32 bit.
The flag --use-old-buffer allows using the old Buffer implementation.
This flag will be removed once V8 4.4 has landed.
The two JS Buffer implementations have been split into two files for
simplicity.
Use getter to return expected .parent/.offset values for backwards
compatibility.
PR-URL: https://github.com/nodejs/io.js/pull/1825
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/node_buffer.h')
-rw-r--r-- | src/node_buffer.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/node_buffer.h b/src/node_buffer.h index 2e649970c4..4b1b2cd859 100644 --- a/src/node_buffer.h +++ b/src/node_buffer.h @@ -63,9 +63,9 @@ NODE_DEPRECATED("Use New(isolate, ...)", // TODO(trevnorris): should be New() for consistency NODE_EXTERN v8::Local<v8::Object> Use(v8::Isolate* isolate, char* data, - uint32_t len); + size_t len); NODE_DEPRECATED("Use Use(isolate, ...)", - inline v8::Local<v8::Object> Use(char* data, uint32_t len) { + inline v8::Local<v8::Object> Use(char* data, size_t len) { return Use(v8::Isolate::GetCurrent(), data, len); }) @@ -95,7 +95,7 @@ v8::Local<v8::Object> New(Environment* env, size_t length, smalloc::FreeCallback callback, void* hint); -v8::Local<v8::Object> Use(Environment* env, char* data, uint32_t length); +v8::Local<v8::Object> Use(Environment* env, char* data, size_t length); #endif // defined(NODE_WANT_INTERNALS) } // namespace Buffer |