Showing with 3 additions and 5 deletions.
  1. +3 −5 lib/fs.js
@@ -38,7 +38,6 @@ var Readable = Stream.Readable;
var Writable = Stream.Writable;

var kMinPoolSpace = 128;
var kPoolSize = 40 * 1024;

var O_APPEND = constants.O_APPEND || 0;
var O_CREAT = constants.O_CREAT || 0;
@@ -1370,8 +1369,8 @@ fs.realpath = function realpath(p, cache, cb) {

var pool;

function allocNewPool() {
pool = new Buffer(kPoolSize);
function allocNewPool(poolSize) {
pool = new Buffer(poolSize);
pool.used = 0;
}

@@ -1468,7 +1467,7 @@ ReadStream.prototype._read = function(n, cb) {
// discard the old pool. Can't add to the free list because
// users might have refernces to slices on it.
pool = null;
allocNewPool();
allocNewPool(this._readableState.bufferSize);
}

// Grab another reference to the pool in the case that while we're
@@ -1560,7 +1559,6 @@ function WriteStream(path, options) {

// a little bit bigger buffer and water marks by default
options = util._extend({
bufferSize: 64 * 1024,
lowWaterMark: 16 * 1024,
highWaterMark: 64 * 1024
}, options || {});