Skip to content

Commit b7c56ac

Browse 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 c9b50a0 commit b7c56ac

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

doc/api/buffer.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5376,7 +5376,7 @@ changes:
53765376
- version: v22.0.0
53775377
pr-url: https://github.com/nodejs/node/pull/52465
53785378
description: Value is changed to 2<sup>53</sup> - 1 on 64-bit
5379-
architectures.
5379+
architectures, and 2<sup>31</sup> - 1 on 32-bit architectures.
53805380
- version: v15.0.0
53815381
pr-url: https://github.com/nodejs/node/pull/35415
53825382
description: Value is changed to 2<sup>32</sup> on 64-bit
@@ -5389,12 +5389,13 @@ changes:
53895389

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

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

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

5397-
It reflects [`v8::TypedArray::kMaxLength`][] under the hood.
5398+
It reflects [`v8::Uint8Array::kMaxLength`][] under the hood.
53985399

53995400
This value is also available as [`buffer.kMaxLength`][].
54005401

@@ -5539,6 +5540,7 @@ introducing security vulnerabilities into an application.
55395540
[`ERR_INVALID_BUFFER_SIZE`]: errors.md#err_invalid_buffer_size
55405541
[`ERR_OUT_OF_RANGE`]: errors.md#err_out_of_range
55415542
[`JSON.stringify()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
5543+
[`Number.MAX_SAFE_INTEGER`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER
55425544
[`String.prototype.indexOf()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf
55435545
[`String.prototype.lastIndexOf()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf
55445546
[`String.prototype.length`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length
@@ -5561,7 +5563,7 @@ introducing security vulnerabilities into an application.
55615563
[`buffer.constants.MAX_STRING_LENGTH`]: #bufferconstantsmax_string_length
55625564
[`buffer.kMaxLength`]: #bufferkmaxlength
55635565
[`util.inspect()`]: util.md#utilinspectobject-options
5564-
[`v8::TypedArray::kMaxLength`]: https://v8.github.io/api/head/classv8_1_1TypedArray.html#a54a48f4373da0850663c4393d843b9b0
5566+
[`v8::Uint8Array::kMaxLength`]: https://v8.github.io/api/head/classv8_1_1Uint8Array.html#a7677e3d0c9c92e4d40bef7212f5980c6
55655567
[base64url]: https://tools.ietf.org/html/rfc4648#section-5
55665568
[endianness]: https://en.wikipedia.org/wiki/Endianness
55675569
[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols

0 commit comments

Comments
 (0)