diff --git a/lib/buffer.js b/lib/buffer.js index 1d98b26d0d49ba..c4b7e3165b8ae5 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -106,13 +106,9 @@ let poolSize, poolOffset, allocPool; const zeroFill = bindingZeroFill || [0]; function createUnsafeBuffer(size) { - return new FastBuffer(createUnsafeArrayBuffer(size)); -} - -function createUnsafeArrayBuffer(size) { zeroFill[0] = 0; try { - return new ArrayBuffer(size); + return new FastBuffer(size); } finally { zeroFill[0] = 1; } @@ -120,7 +116,7 @@ function createUnsafeArrayBuffer(size) { function createPool() { poolSize = Buffer.poolSize; - allocPool = createUnsafeArrayBuffer(poolSize); + allocPool = createUnsafeBuffer(poolSize).buffer; poolOffset = 0; } createPool();