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

docs: fix smalloc.dispose() example #8625

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion doc/api/smalloc.markdown
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`.

Choose a reason for hiding this comment

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

It does make me sad V8 doesn't provide a way to remove this.

`dispose()` does not support Buffers, and will throw if passed.

### smalloc.hasExternalData(obj)
Expand Down