@@ -103,14 +103,13 @@ use the shared internal memory pool.
103
103
### The ` --zero-fill-buffers ` command line option
104
104
105
105
Node.js can be started using the ` --zero-fill-buffers ` command line option to
106
- force all newly allocated ` Buffer ` and ` SlowBuffer ` instances created using
107
- either ` new Buffer(size) ` , ` Buffer.allocUnsafe(size) ` ,
108
- ` Buffer.allocUnsafeSlow(size) ` or ` new SlowBuffer(size) ` to be * automatically
109
- zero-filled* upon creation. Use of this flag * changes the default behavior* of
110
- these methods and * can have a significant impact* on performance. Use of the
111
- ` --zero-fill-buffers ` option is recommended only when absolutely necessary to
112
- enforce that newly allocated ` Buffer ` instances cannot contain potentially
113
- sensitive data.
106
+ force all newly allocated ` Buffer ` instances created using either
107
+ ` new Buffer(size) ` , ` Buffer.allocUnsafe(size) ` , ` Buffer.allocUnsafeSlow(size) `
108
+ or ` new SlowBuffer(size) ` to be * automatically zero-filled* upon creation. Use
109
+ of this flag * changes the default behavior* of these methods and * can have a
110
+ significant impact* on performance. Use of the ` --zero-fill-buffers ` option is
111
+ recommended only when absolutely necessary to enforce that newly allocated
112
+ ` Buffer ` instances cannot contain potentially sensitive data.
114
113
115
114
```
116
115
$ node --zero-fill-buffers
@@ -342,8 +341,8 @@ console.log(buf);
342
341
Allocates a new ` Buffer ` of ` size ` bytes. The ` size ` must be less than
343
342
or equal to the value of ` require('buffer').kMaxLength ` (on 64-bit
344
343
architectures, ` kMaxLength ` is ` (2^31)-1 ` ). Otherwise, a [ ` RangeError ` ] [ ] is
345
- thrown. If a ` size ` less than 0 is specified, a zero-length Buffer will be
346
- created .
344
+ thrown. A zero-length Buffer will be created if a ` size ` less than or equal to
345
+ 0 is specified .
347
346
348
347
Unlike ` ArrayBuffers ` , the underlying memory for ` Buffer ` instances created in
349
348
this way is * not initialized* . The contents of a newly created ` Buffer ` are
@@ -400,8 +399,8 @@ console.log(buf);
400
399
401
400
The ` size ` must be less than or equal to the value of
402
401
` require('buffer').kMaxLength ` (on 64-bit architectures, ` kMaxLength ` is
403
- ` (2^31)-1 ` ). Otherwise, a [ ` RangeError ` ] [ ] is thrown. If a ` size ` less than 0
404
- is specified, a zero-length ` Buffer ` will be created .
402
+ ` (2^31)-1 ` ). Otherwise, a [ ` RangeError ` ] [ ] is thrown. A zero-length Buffer will
403
+ be created if a ` size ` less than or equal to 0 is specified .
405
404
406
405
If ` fill ` is specified, the allocated ` Buffer ` will be initialized by calling
407
406
` buf.fill(fill) ` . See [ ` buf.fill() ` ] [ ] for more information.
@@ -434,8 +433,8 @@ A `TypeError` will be thrown if `size` is not a number.
434
433
Allocates a new * non-zero-filled* ` Buffer ` of ` size ` bytes. The ` size ` must
435
434
be less than or equal to the value of ` require('buffer').kMaxLength ` (on 64-bit
436
435
architectures, ` kMaxLength ` is ` (2^31)-1 ` ). Otherwise, a [ ` RangeError ` ] [ ] is
437
- thrown. If a ` size ` less than 0 is specified, a zero-length ` Buffer ` will be
438
- created .
436
+ thrown. A zero-length Buffer will be created if a ` size ` less than or equal to
437
+ 0 is specified .
439
438
440
439
The underlying memory for ` Buffer ` instances created in this way is * not
441
440
initialized* . The contents of the newly created ` Buffer ` are unknown and
@@ -476,8 +475,8 @@ additional performance that `Buffer.allocUnsafe(size)` provides.
476
475
Allocates a new * non-zero-filled* and non-pooled ` Buffer ` of ` size ` bytes. The
477
476
` size ` must be less than or equal to the value of
478
477
` require('buffer').kMaxLength ` (on 64-bit architectures, ` kMaxLength ` is
479
- ` (2^31)-1 ` ). Otherwise, a [ ` RangeError ` ] [ ] is thrown. If a ` size ` less than 0
480
- is specified, a zero-length ` Buffer ` will be created .
478
+ ` (2^31)-1 ` ). Otherwise, a [ ` RangeError ` ] [ ] is thrown. A zero-length Buffer will
479
+ be created if a ` size ` less than or equal to 0 is specified .
481
480
482
481
The underlying memory for ` Buffer ` instances created in this way is * not
483
482
initialized* . The contents of the newly created ` Buffer ` are unknown and
@@ -1824,8 +1823,8 @@ has observed undue memory retention in their applications.
1824
1823
Allocates a new ` SlowBuffer ` of ` size ` bytes. The ` size ` must be less than
1825
1824
or equal to the value of ` require('buffer').kMaxLength ` (on 64-bit
1826
1825
architectures, ` kMaxLength ` is ` (2^31)-1 ` ). Otherwise, a [ ` RangeError ` ] [ ] is
1827
- thrown. If a ` size ` less than 0 is specified, a zero-length ` SlowBuffer ` will be
1828
- created .
1826
+ thrown. A zero-length Buffer will be created if a ` size ` less than or equal to
1827
+ 0 is specified .
1829
1828
1830
1829
The underlying memory for ` SlowBuffer ` instances is * not initialized* . The
1831
1830
contents of a newly created ` SlowBuffer ` are unknown and could contain
0 commit comments