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: #38368
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
takayama-lily authored and targos committed Apr 29, 2021
1 parent f1ea2c8 commit 67cd88d
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 67cd88d

Please sign in to comment.