MCPcopy Create free account
hub / github.com/bewcloud/bewcloud / allocUnsafe

Function allocUnsafe

lib/models/dav.js:2060–2069  ·  view source on GitHub ↗
(that, size)

Source from the content-addressed store, hash-verified

2058};
2059
2060function allocUnsafe (that, size) {
2061 assertSize(size);
2062 that = createBuffer(that, size < 0 ? 0 : checked(size) | 0);
2063 if (!Buffer.TYPED_ARRAY_SUPPORT) {
2064 for (var i = 0; i < size; ++i) {
2065 that[i] = 0;
2066 }
2067 }
2068 return that
2069}
2070
2071/**
2072 * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.

Callers 2

BufferFunction · 0.85
dav.jsFile · 0.85

Calls 3

assertSizeFunction · 0.85
createBufferFunction · 0.85
checkedFunction · 0.85

Tested by

no test coverage detected