@@ -434,7 +434,7 @@ Prior to Node.js 8.0.0, the underlying memory for `Buffer` instances
434434created in this way is * not initialized* . The contents of a newly created
435435` Buffer ` are unknown and * may contain sensitive data* . Use
436436[ ` Buffer.alloc(size) ` ] [ `Buffer.alloc()` ] instead to initialize a ` Buffer `
437- to zeroes.
437+ with zeroes.
438438
439439``` js
440440const buf = new Buffer (10 );
@@ -550,7 +550,7 @@ thrown. A zero-length `Buffer` will be created if `size` is 0.
550550The underlying memory for ` Buffer ` instances created in this way is * not
551551initialized* . The contents of the newly created ` Buffer ` are unknown and
552552* may contain sensitive data* . Use [ ` Buffer.alloc() ` ] instead to initialize
553- ` Buffer ` instances to zeroes.
553+ ` Buffer ` instances with zeroes.
554554
555555``` js
556556const buf = Buffer .allocUnsafe (10 );
@@ -593,20 +593,20 @@ thrown. A zero-length `Buffer` will be created if `size` is 0.
593593
594594The underlying memory for ` Buffer ` instances created in this way is * not
595595initialized* . The contents of the newly created ` Buffer ` are unknown and
596- * may contain sensitive data* . Use [ ` buf.fill(0) ` ] [ `buf.fill()` ] to initialize such
597- ` Buffer ` instances to zeroes.
596+ * may contain sensitive data* . Use [ ` buf.fill(0) ` ] [ `buf.fill()` ] to initialize
597+ such ` Buffer ` instances with zeroes.
598598
599599When using [ ` Buffer.allocUnsafe() ` ] to allocate new ` Buffer ` instances,
600- allocations under 4KB are, by default, sliced from a single pre-allocated
601- ` Buffer ` . This allows applications to avoid the garbage collection overhead of
602- creating many individually allocated ` Buffer ` instances. This approach improves
603- both performance and memory usage by eliminating the need to track and cleanup as
604- many ` Persistent ` objects.
600+ allocations under 4KB are sliced from a single pre-allocated ` Buffer ` . This
601+ allows applications to avoid the garbage collection overhead of creating many
602+ individually allocated ` Buffer ` instances. This approach improves both
603+ performance and memory usage by eliminating the need to track and clean up as
604+ many persistent objects.
605605
606606However, in the case where a developer may need to retain a small chunk of
607607memory from a pool for an indeterminate amount of time, it may be appropriate
608- to create an un-pooled ` Buffer ` instance using ` Buffer.allocUnsafeSlow() ` then
609- copy out the relevant bits.
608+ to create an un-pooled ` Buffer ` instance using ` Buffer.allocUnsafeSlow() ` and
609+ then copying out the relevant bits.
610610
611611``` js
612612// Need to keep around a few small chunks of memory
@@ -625,8 +625,8 @@ socket.on('readable', () => {
625625});
626626```
627627
628- Use of ` Buffer.allocUnsafeSlow() ` should be used only as a last resort * after*
629- a developer has observed undue memory retention in their applications.
628+ ` Buffer.allocUnsafeSlow() ` should be used only as a last resort after a
629+ developer has observed undue memory retention in their applications.
630630
631631A ` TypeError ` will be thrown if ` size ` is not a number.
632632
@@ -2464,7 +2464,8 @@ thrown. A zero-length `Buffer` will be created if `size` is 0.
24642464
24652465The underlying memory for ` SlowBuffer ` instances is * not initialized* . The
24662466contents of a newly created ` SlowBuffer ` are unknown and may contain sensitive
2467- data. Use [ ` buf.fill(0) ` ] [ `buf.fill()` ] to initialize a ` SlowBuffer ` to zeroes.
2467+ data. Use [ ` buf.fill(0) ` ] [ `buf.fill()` ] to initialize a ` SlowBuffer ` with
2468+ zeroes.
24682469
24692470``` js
24702471const { SlowBuffer } = require (' buffer' );
0 commit comments