Skip to content

Commit 9930b6b

Browse files
Ayase-252targos
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]> Backport-PR-URL: #38232
1 parent fc8f1b7 commit 9930b6b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

doc/api/buffer.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -3140,12 +3140,20 @@ added: v8.2.0
31403140
#### `buffer.constants.MAX_LENGTH`
31413141
<!-- YAML
31423142
added: v8.2.0
3143+
changes:
3144+
- version: v14.0.0
3145+
pr-url: https://github.com/nodejs/node/pull/32116
3146+
description: Value is changed from 2<sup>31</sup> - 1 to
3147+
2<sup>32</sup> - 1 on 64-bit architectures.
31433148
-->
31443149

31453150
* {integer} The largest size allowed for a single `Buffer` instance.
31463151

31473152
On 32-bit architectures, this value currently is 2<sup>30</sup> - 1 (~1GB).
3148-
On 64-bit architectures, this value currently is 2<sup>31</sup> - 1 (~2GB).
3153+
3154+
On 64-bit architectures, this value currently is 2<sup>32</sup> - 1 (~4GB).
3155+
3156+
It reflects [`v8::TypedArray::kMaxLength`][] under the hood.
31493157

31503158
This value is also available as [`buffer.kMaxLength`][].
31513159

@@ -3314,6 +3322,7 @@ introducing security vulnerabilities into an application.
33143322
[`buffer.constants.MAX_STRING_LENGTH`]: #buffer_buffer_constants_max_string_length
33153323
[`buffer.kMaxLength`]: #buffer_buffer_kmaxlength
33163324
[`util.inspect()`]: util.md#util_util_inspect_object_options
3325+
[`v8::TypedArray::kMaxLength`]: https://v8.github.io/api/head/classv8_1_1TypedArray.html#a54a48f4373da0850663c4393d843b9b0
33173326
[binary strings]: https://developer.mozilla.org/en-US/docs/Web/API/DOMString/Binary
33183327
[endianness]: https://en.wikipedia.org/wiki/Endianness
33193328
[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols

0 commit comments

Comments
 (0)