This repository was archived by the owner on Apr 22, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
API changes between v0.10 and v0.12
Trevor Norris edited this page Jul 4, 2013
·
16 revisions
When editing this page please be as detailed as possible. Examples are encouraged!
-
Bufferclass has been removed and replaced with a namespace. Sousing node::Bufferwill no longer work. - All
node::Buffer::New()variants now returnLocal<Object>instead ofBuffer*. - The return value for
node::Buffer::New()is an instantiated JSBufferobject. -
node::Buffer::New(Handle<String>)now accepts an optional second argument ofenum encoding. - API addition of
node::Buffer::Use()which will use the passedchar*instead of making a copy.
- External memory is now allocated using
smalloc, instead of usingSlowBufferas the parent backing. -
SlowBufferhas been repurposed to return aBufferinstance that has no parent backing. -
buffer.parentnow points to an object that has been allocated viasmalloc.alloc, not aBufferinstance, and only if the buffer is a slice. -
buffer.offsetis now a read-only prototype property equal to zero since no instance methods require working on the parent backing. - API additions
Buffer.alloc()andBuffer.dipose()have been added. -
Buffer#fill()has been extended to fill with the entire passed value.