@@ -3140,12 +3140,24 @@ added: v8.2.0
31403140#### ` buffer.constants.MAX_LENGTH `
31413141<!-- YAML
31423142added: v8.2.0
3143+ changes:
3144+ - version: v15.0.0
3145+ pr-url: https://github.com/nodejs/node/pull/35415
3146+ description: Value is changed to 2<sup>32</sup> on 64-bit
3147+ architectures.
3148+ - version: v14.0.0
3149+ pr-url: https://github.com/nodejs/node/pull/32116
3150+ description: Value is changed from 2<sup>31</sup> - 1 to
3151+ 2<sup>32</sup> - 1 on 64-bit architectures.
31433152-->
31443153
31453154* {integer} The largest size allowed for a single ` Buffer ` instance.
31463155
31473156On 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).
3157+
3158+ On 64-bit architectures, this value currently is 2<sup >32</sup > (~ 4GB).
3159+
3160+ It reflects [ ` v8::TypedArray::kMaxLength ` ] [ ] under the hood.
31493161
31503162This value is also available as [ ` buffer.kMaxLength ` ] [ ] .
31513163
@@ -3314,6 +3326,8 @@ introducing security vulnerabilities into an application.
33143326[ `buffer.constants.MAX_STRING_LENGTH` ] : #buffer_buffer_constants_max_string_length
33153327[ `buffer.kMaxLength` ] : #buffer_buffer_kmaxlength
33163328[ `util.inspect()` ] : util.md#util_util_inspect_object_options
3329+ [ `v8::TypedArray::kMaxLength` ] : https://v8.github.io/api/head/classv8_1_1TypedArray.html#a54a48f4373da0850663c4393d843b9b0
3330+ [ base64url ] : https://tools.ietf.org/html/rfc4648#section-5
33173331[ binary strings ] : https://developer.mozilla.org/en-US/docs/Web/API/DOMString/Binary
33183332[ endianness ] : https://en.wikipedia.org/wiki/Endianness
33193333[ iterator ] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols
0 commit comments