function alloc(size, fill, encoding) {
assertSize(size);
if (fill !== undefined && fill !== 0 && size > 0) {
const buf = createUnsafeBuffer(size);
return _fill(buf, fill, 0, buf.length, encoding);
}
return new FastBuffer(size);
}
function Buffer(arg, encodingOrOffset, length) {
showFlaggedDeprecation();
// Common case.
if (typeof arg === 'number') {
if (typeof encodingOrOffset === 'string') {
throw new ERR_INVALID_ARG_TYPE('string', 'string', arg);
}
return Buffer.alloc(arg);
}
return Buffer.from(arg, encodingOrOffset, length);
}