Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
docs: fix smalloc.dispose() example
Browse files Browse the repository at this point in the history
Also couple of additions about dispose and limitations of smalloc'ed
objects.

Fixes: #8625
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
  • Loading branch information
vkurchatkin authored and trevnorris committed Oct 27, 2014
1 parent 6a68d64 commit 15aa47e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion doc/api/smalloc.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ possible options are listed in `smalloc.Types`. Example usage:

// { '0': 0, '1': 0.1, '2': 0.2 }

It is not possible to freeze, seal and prevent extensions of objects with
external data using `Object.freeze`, `Object.seal` and
`Object.preventExtensions` respectively.

### smalloc.copyOnto(source, sourceStart, dest, destStart, copyLength);

* `source` {Object} with external array allocation
Expand Down Expand Up @@ -105,8 +109,10 @@ careful. Cryptic errors may arise in applications that are difficult to trace.
smalloc.copyOnto(b, 2, a, 0, 2);

// now results in:
// Error: source has no external array data
// RangeError: copy_length > source_length

After `dispose()` is called object still behaves as one with external data, for
example `smalloc.hasExternalData()` returns `true`.
`dispose()` does not support Buffers, and will throw if passed.

### smalloc.hasExternalData(obj)
Expand Down

1 comment on commit 15aa47e

@trevnorris
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Crap. Fixes: should have been PR-URL:. My bad.

Please sign in to comment.