Skip to content

Commit 756d2e4

Browse files
Ayase-252jasnell
authored andcommitted
doc: update buffer.constants.MAX_LENGTH
Fixes: #38093 PR-URL: #38109 Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 993ed19 commit 756d2e4

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Diff for: doc/api/buffer.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -3410,12 +3410,24 @@ added: v8.2.0
34103410
#### `buffer.constants.MAX_LENGTH`
34113411
<!-- YAML
34123412
added: v8.2.0
3413+
changes:
3414+
- version: v15.0.0
3415+
pr-url: https://github.com/nodejs/node/pull/35415
3416+
description: Value is changed to 2<sup>32</sup> on 64-bit
3417+
architectures.
3418+
- version: v14.0.0
3419+
pr-url: https://github.com/nodejs/node/pull/32116
3420+
description: Value is changed from 2<sup>31</sup> - 1 to
3421+
2<sup>32</sup> - 1 on 64-bit architectures.
34133422
-->
34143423

34153424
* {integer} The largest size allowed for a single `Buffer` instance.
34163425

34173426
On 32-bit architectures, this value currently is 2<sup>30</sup> - 1 (~1GB).
3418-
On 64-bit architectures, this value currently is 2<sup>31</sup> - 1 (~2GB).
3427+
3428+
On 64-bit architectures, this value currently is 2<sup>32</sup> (~4GB).
3429+
3430+
It reflects [`v8::TypedArray::kMaxLength`][] under the hood.
34193431

34203432
This value is also available as [`buffer.kMaxLength`][].
34213433

@@ -3585,6 +3597,7 @@ introducing security vulnerabilities into an application.
35853597
[`buffer.constants.MAX_STRING_LENGTH`]: #buffer_buffer_constants_max_string_length
35863598
[`buffer.kMaxLength`]: #buffer_buffer_kmaxlength
35873599
[`util.inspect()`]: util.md#util_util_inspect_object_options
3600+
[`v8::TypedArray::kMaxLength`]: https://v8.github.io/api/head/classv8_1_1TypedArray.html#a54a48f4373da0850663c4393d843b9b0
35883601
[base64url]: https://tools.ietf.org/html/rfc4648#section-5
35893602
[binary strings]: https://developer.mozilla.org/en-US/docs/Web/API/DOMString/Binary
35903603
[endianness]: https://en.wikipedia.org/wiki/Endianness

0 commit comments

Comments
 (0)