Skip to content

Commit 67cd88d

Browse files
takayama-lilytargos
authored andcommitted
doc: fix typo in worker_threads.md
"Buffer.alloc()" -> "Buffer.allocUnsafe()" Buffer.alloc() does not use the internal Buffer pool. PR-URL: #38368 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent f1ea2c8 commit 67cd88d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/api/worker_threads.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ Depending on how a `Buffer` instance was created, it may or may
666666
not own its underlying `ArrayBuffer`. An `ArrayBuffer` must not
667667
be transferred unless it is known that the `Buffer` instance
668668
owns it. In particular, for `Buffer`s created from the internal
669-
`Buffer` pool (using, for instance `Buffer.from()` or `Buffer.alloc()`),
669+
`Buffer` pool (using, for instance `Buffer.from()` or `Buffer.allocUnsafe()`),
670670
transferring them is not possible and they are always cloned,
671671
which sends a copy of the entire `Buffer` pool.
672672
This behavior may come with unintended higher memory

0 commit comments

Comments
 (0)