diff options
author | takayama <takayama@foxmail.com> | 2021-04-23 17:21:13 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2021-04-26 19:31:05 +0300 |
commit | 0577fe3f2690bff0f7cf1a60613cdc3d50b59e4a (patch) | |
tree | eee3927658ae9e4bd039f198f132284fd109ebcd /doc/api/worker_threads.md | |
parent | b2be410f533c4fdce60ed0d257ab7a6cd2f1da8a (diff) |
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>
Diffstat (limited to 'doc/api/worker_threads.md')
-rw-r--r-- | doc/api/worker_threads.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index f35757fe82d..5d0781751ca 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -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 |