Skip to content

Commit

Permalink
doc: fix typo in worker_threads.md
Browse files Browse the repository at this point in the history
"Buffer.alloc()" -> "Buffer.allocUnsafe()"

Buffer.alloc() does not use the internal Buffer pool.

PR-URL: nodejs#38368
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
takayama-lily authored and Trott committed Apr 26, 2021
1 parent b2be410 commit 0577fe3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/api/worker_threads.md
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ Depending on how a `Buffer` instance was created, it may or may
not own its underlying `ArrayBuffer`. An `ArrayBuffer` must not
be transferred unless it is known that the `Buffer` instance
owns it. In particular, for `Buffer`s created from the internal
`Buffer` pool (using, for instance `Buffer.from()` or `Buffer.alloc()`),
`Buffer` pool (using, for instance `Buffer.from()` or `Buffer.allocUnsafe()`),
transferring them is not possible and they are always cloned,
which sends a copy of the entire `Buffer` pool.
This behavior may come with unintended higher memory
Expand Down

0 comments on commit 0577fe3

Please sign in to comment.