mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
doc: fix typo in worker_threads.md
"Buffer.alloc()" -> "Buffer.allocUnsafe()" Buffer.alloc() does not use the internal Buffer pool. PR-URL: https://github.com/nodejs/node/pull/38368 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
1 parent
f1ea2c8e2b
commit
67cd88da00
1 file changed
+1
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user