mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
doc: fix a formatting error in buffer.md
It was treated as a link to "e.g. `Uint8Array.from()`". PR-URL: https://github.com/nodejs/node/pull/8553 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Bryan English <bryan@bryanenglish.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
This commit is contained in:
1 parent
2a2ec9dbc3
commit
ffe8dffbc4
1 file changed
+6
-6
+6
-6
@@ -253,10 +253,10 @@ const buf = Buffer.from(arr.buffer, 0, 16);
|
||||
console.log(buf.length);
|
||||
```
|
||||
|
||||
The `Buffer.from()` and [`TypedArray.from()`] (e.g. `Uint8Array.from()`) have
|
||||
different signatures and implementations. Specifically, the [`TypedArray`] variants
|
||||
accept a second argument that is a mapping function that is invoked on every
|
||||
element of the typed array:
|
||||
The `Buffer.from()` and [`TypedArray.from()`] have different signatures and
|
||||
implementations. Specifically, the [`TypedArray`] variants accept a second
|
||||
argument that is a mapping function that is invoked on every element of the
|
||||
typed array:
|
||||
|
||||
* `TypedArray.from(source[, mapFn[, thisArg]])`
|
||||
|
||||
@@ -538,8 +538,8 @@ A `TypeError` will be thrown if `size` is not a number.
|
||||
|
||||
Note that the `Buffer` module pre-allocates an internal `Buffer` instance of
|
||||
size [`Buffer.poolSize`] that is used as a pool for the fast allocation of new
|
||||
`Buffer` instances created using [`Buffer.allocUnsafe()`] (and the deprecated
|
||||
`new Buffer(size)` constructor) only when `size` is less than or equal to
|
||||
`Buffer` instances created using [`Buffer.allocUnsafe()`] and the deprecated
|
||||
`new Buffer(size)` constructor only when `size` is less than or equal to
|
||||
`Buffer.poolSize >> 1` (floor of [`Buffer.poolSize`] divided by two).
|
||||
|
||||
Use of this pre-allocated internal memory pool is a key difference between
|
||||
|
||||
Reference in new issue
Block a user