Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup: doc: update buffer.constants.MAX_LENGTH
  • Loading branch information
Ayase-252 committed Apr 7, 2021
commit 06fb5650b7651e02620f03c99e47994f76359c0a
16 changes: 12 additions & 4 deletions doc/api/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -3410,16 +3410,24 @@ added: v8.2.0
#### `buffer.constants.MAX_LENGTH`
<!-- YAML
added: v8.2.0
changes:
- version: v15.0.0
pr-url: https://github.com/nodejs/node/pull/35415
description: Value is changed to 2<sup>32</sup> (~4GB) on 64-bit
Comment thread
jasnell marked this conversation as resolved.
Outdated
architectures.
- version: v14.0.0
pr-url: https://github.com/nodejs/node/pull/32116
description: Value is changed to 2<sup>32</sup> - 1 (~4GB) on 64-bit
architectures.
Comment thread
jasnell marked this conversation as resolved.
Outdated
-->

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

On 32-bit architectures, this value currently is 2<sup>30</sup> - 1 (~1GB).
On 64-bit architectures, this value currently is

* for v12: 2<sup>31</sup> - 1 (~2GB)
* for v14: 2<sup>32</sup> - 1 (~4GB)
* for v15: 2<sup>32</sup>(~4GB)
On 64-bit architectures, this value varies from Node.js version to version.
It is at least 2<sup>31</sup> - 1 (~2GB) and currently is 2<sup>32</sup>
(~4GB). See history for detail.

It reflects [`v8::TypedArray::kMaxLength`][] under the hood.

Expand Down