diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 34e408453249cd..66b04675641a42 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -5356,7 +5356,7 @@ changes: - version: v22.0.0 pr-url: https://github.com/nodejs/node/pull/52465 description: Value is changed to 253 - 1 on 64-bit - architectures. + architectures, and 231 - 1 on 32-bit architectures. - version: v15.0.0 pr-url: https://github.com/nodejs/node/pull/35415 description: Value is changed to 232 on 64-bit @@ -5369,12 +5369,13 @@ changes: * Type: {integer} The largest size allowed for a single `Buffer` instance. -On 32-bit architectures, this value currently is 230 - 1 (about 1 +On 32-bit architectures, this value is equal to 231 - 1 (about 2 GiB). -On 64-bit architectures, this value currently is 253 - 1 (about 8 PiB). +On 64-bit architectures, this value is equal to [`Number.MAX_SAFE_INTEGER`][] +(253 - 1, about 8 PiB). -It reflects [`v8::TypedArray::kMaxLength`][] under the hood. +It reflects [`v8::Uint8Array::kMaxLength`][] under the hood. This value is also available as [`buffer.kMaxLength`][]. @@ -5519,6 +5520,7 @@ introducing security vulnerabilities into an application. [`ERR_INVALID_BUFFER_SIZE`]: errors.md#err_invalid_buffer_size [`ERR_OUT_OF_RANGE`]: errors.md#err_out_of_range [`JSON.stringify()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify +[`Number.MAX_SAFE_INTEGER`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER [`String.prototype.indexOf()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf [`String.prototype.lastIndexOf()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf [`String.prototype.length`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length @@ -5541,7 +5543,7 @@ introducing security vulnerabilities into an application. [`buffer.constants.MAX_STRING_LENGTH`]: #bufferconstantsmax_string_length [`buffer.kMaxLength`]: #bufferkmaxlength [`util.inspect()`]: util.md#utilinspectobject-options -[`v8::TypedArray::kMaxLength`]: https://v8.github.io/api/head/classv8_1_1TypedArray.html#a54a48f4373da0850663c4393d843b9b0 +[`v8::Uint8Array::kMaxLength`]: https://v8.github.io/api/head/classv8_1_1Uint8Array.html#a7677e3d0c9c92e4d40bef7212f5980c6 [base64url]: https://tools.ietf.org/html/rfc4648#section-5 [endianness]: https://en.wikipedia.org/wiki/Endianness [iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols