@@ -3410,12 +3410,24 @@ added: v8.2.0
3410
3410
#### ` buffer.constants.MAX_LENGTH `
3411
3411
<!-- YAML
3412
3412
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.
3413
3422
-->
3414
3423
3415
3424
* {integer} The largest size allowed for a single ` Buffer ` instance.
3416
3425
3417
3426
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.
3419
3431
3420
3432
This value is also available as [ ` buffer.kMaxLength ` ] [ ] .
3421
3433
@@ -3585,6 +3597,7 @@ introducing security vulnerabilities into an application.
3585
3597
[ `buffer.constants.MAX_STRING_LENGTH` ] : #buffer_buffer_constants_max_string_length
3586
3598
[ `buffer.kMaxLength` ] : #buffer_buffer_kmaxlength
3587
3599
[ `util.inspect()` ] : util.md#util_util_inspect_object_options
3600
+ [ `v8::TypedArray::kMaxLength` ] : https://v8.github.io/api/head/classv8_1_1TypedArray.html#a54a48f4373da0850663c4393d843b9b0
3588
3601
[ base64url ] : https://tools.ietf.org/html/rfc4648#section-5
3589
3602
[ binary strings ] : https://developer.mozilla.org/en-US/docs/Web/API/DOMString/Binary
3590
3603
[ endianness ] : https://en.wikipedia.org/wiki/Endianness
0 commit comments