bare-tty 5.2.0 → 5.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -99,7 +99,10 @@ exports.ReadStream = class TTYReadStream extends Readable {
99
99
  return
100
100
  }
101
101
 
102
- const copy = Buffer.allocUnsafe(read)
102
+ // Unpooled, as a read too small to be given a buffer of its own would
103
+ // otherwise pin the whole pool it came from for as long as its consumer
104
+ // holds on to it.
105
+ const copy = Buffer.allocUnsafeSlow(read)
103
106
  copy.set(this._buffer.subarray(0, read))
104
107
 
105
108
  if (this.push(copy) === false && this.destroying === false) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-tty",
3
- "version": "5.2.0",
3
+ "version": "5.2.1",
4
4
  "description": "Native TTY streams for JavaScript",
5
5
  "exports": {
6
6
  "./package": "./package.json",
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file