Skip to content

Commit df54a19

Browse files
Trottcodebytere
authored andcommittedMar 30, 2020
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 <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 3574116 commit df54a19

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed
 

‎doc/api/buffer.md

+6-9
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,12 @@ added: v5.10.0
123123
-->
124124

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

136133
```console
137134
$ node --zero-fill-buffers

0 commit comments

Comments
 (0)
Please sign in to comment.