From 67cd88da008e85e2c93ac489be0c54e1ad74e4ae Mon Sep 17 00:00:00 2001 From: takayama Date: Fri, 23 Apr 2021 23:21:13 +0900 Subject: [PATCH] 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 Reviewed-By: Rich Trott --- doc/api/worker_threads.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index f35757fe82d032..5d0781751ca6b2 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