Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e3c5dcf

Browse filesBrowse files
Renegade334aduh95
authored andcommitted
doc: correct values/references for buffer.kMaxLength
PR-URL: #60305 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent a25d76c commit e3c5dcf
Copy full SHA for e3c5dcf

File tree

Expand file treeCollapse file tree

1 file changed

+7
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-5
lines changed
Open diff view settings
Collapse file

‎doc/api/buffer.md‎

Copy file name to clipboardExpand all lines: doc/api/buffer.md
+7-5Lines changed: 7 additions & 5 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -5356,7 +5356,7 @@ changes:
53565356
- version: v22.0.0
53575357
pr-url: https://github.com/nodejs/node/pull/52465
53585358
description: Value is changed to 2<sup>53</sup> - 1 on 64-bit
5359-
architectures.
5359+
architectures, and 2<sup>31</sup> - 1 on 32-bit architectures.
53605360
- version: v15.0.0
53615361
pr-url: https://github.com/nodejs/node/pull/35415
53625362
description: Value is changed to 2<sup>32</sup> on 64-bit
@@ -5369,12 +5369,13 @@ changes:
53695369

53705370
* Type: {integer} The largest size allowed for a single `Buffer` instance.
53715371

5372-
On 32-bit architectures, this value currently is 2<sup>30</sup> - 1 (about 1
5372+
On 32-bit architectures, this value is equal to 2<sup>31</sup> - 1 (about 2
53735373
GiB).
53745374

5375-
On 64-bit architectures, this value currently is 2<sup>53</sup> - 1 (about 8 PiB).
5375+
On 64-bit architectures, this value is equal to [`Number.MAX_SAFE_INTEGER`][]
5376+
(2<sup>53</sup> - 1, about 8 PiB).
53765377

5377-
It reflects [`v8::TypedArray::kMaxLength`][] under the hood.
5378+
It reflects [`v8::Uint8Array::kMaxLength`][] under the hood.
53785379

53795380
This value is also available as [`buffer.kMaxLength`][].
53805381

@@ -5519,6 +5520,7 @@ introducing security vulnerabilities into an application.
55195520
[`ERR_INVALID_BUFFER_SIZE`]: errors.md#err_invalid_buffer_size
55205521
[`ERR_OUT_OF_RANGE`]: errors.md#err_out_of_range
55215522
[`JSON.stringify()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
5523+
[`Number.MAX_SAFE_INTEGER`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER
55225524
[`String.prototype.indexOf()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf
55235525
[`String.prototype.lastIndexOf()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf
55245526
[`String.prototype.length`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length
@@ -5541,7 +5543,7 @@ introducing security vulnerabilities into an application.
55415543
[`buffer.constants.MAX_STRING_LENGTH`]: #bufferconstantsmax_string_length
55425544
[`buffer.kMaxLength`]: #bufferkmaxlength
55435545
[`util.inspect()`]: util.md#utilinspectobject-options
5544-
[`v8::TypedArray::kMaxLength`]: https://v8.github.io/api/head/classv8_1_1TypedArray.html#a54a48f4373da0850663c4393d843b9b0
5546+
[`v8::Uint8Array::kMaxLength`]: https://v8.github.io/api/head/classv8_1_1Uint8Array.html#a7677e3d0c9c92e4d40bef7212f5980c6
55455547
[base64url]: https://tools.ietf.org/html/rfc4648#section-5
55465548
[endianness]: https://en.wikipedia.org/wiki/Endianness
55475549
[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.