Skip to content
Merged
Changes from all commits
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
doc: revise --zero-fill-buffers text in buffer.md
There was an unclear sentence fragment that needed fixing, so I edited
the entire paragraph for clarity. I also removed irrelevant information
about behavior before Node.js 8.0.0. That version of Node.js is no
longer supported and these docs will never apply to 8.0.0. (At the time
of this writing, 10.x is the oldest supported line, and so changes to
the docs will never be backported farther than the 10.x docs.)

PR-URL: #32019
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: David Carlier <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
Trott committed Mar 2, 2020
commit 4c35b62f64a72eb5234ba805c19add36e46b1e9e
15 changes: 6 additions & 9 deletions doc/api/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,12 @@ added: v5.10.0
-->

Node.js can be started using the `--zero-fill-buffers` command line option to
cause all newly allocated `Buffer` instances to be zero-filled upon creation by
default. Before Node.js 8.0.0, this included buffers allocated by `new
Buffer(size)`. Since Node.js 8.0.0, buffers allocated with `new` are always
zero-filled, whether this option is used or not.
[`Buffer.allocUnsafe()`][], [`Buffer.allocUnsafeSlow()`][], and `new
SlowBuffer(size)`. Use of this flag can have a significant negative impact on
performance. Use of the `--zero-fill-buffers` option is recommended only when
necessary to enforce that newly allocated `Buffer` instances cannot contain old
data that is potentially sensitive.
cause all newly-allocated `Buffer` instances to be zero-filled upon creation by
default. Without the option, buffers created with [`Buffer.allocUnsafe()`][],
[`Buffer.allocUnsafeSlow()`][], and `new SlowBuffer(size)` are not zero-filled.
Use of this flag can have a significant negative impact on performance. Use the
`--zero-fill-buffers` option only when necessary to enforce that newly allocated
`Buffer` instances cannot contain old data that is potentially sensitive.

```console
$ node --zero-fill-buffers
Expand Down