MCPcopy Index your code
hub / github.com/nodejs/node / allocateEmptyBuffers

Function allocateEmptyBuffers

test/parallel/test-fs-readv.js:16–23  ·  view source on GitHub ↗
(combinedLength)

Source from the content-addressed store, hash-verified

14const exptectedBuff = Buffer.from(expected);
15
16const allocateEmptyBuffers = (combinedLength) => {
17 const bufferArr = [];
18 // Allocate two buffers, each half the size of exptectedBuff
19 bufferArr[0] = Buffer.alloc(Math.floor(combinedLength / 2));
20 bufferArr[1] = Buffer.alloc(combinedLength - bufferArr[0].length);
21
22 return bufferArr;
23};
24
25const getCallback = (fd, bufferArr) => {
26 return common.mustSucceed((bytesRead, buffers) => {

Callers 1

test-fs-readv.jsFile · 0.70

Calls 1

allocMethod · 0.80

Tested by

no test coverage detected