MCPcopy Create free account
hub / github.com/microsoft/SandDance / allocUnsafe

Function allocUnsafe

docs/tests/v2/es6/js/sanddance.js:78567–78576  ·  view source on GitHub ↗
(that, size)

Source from the content-addressed store, hash-verified

78565}
78566
78567function allocUnsafe (that, size) {
78568 assertSize(size)
78569 that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
78570 if (!Buffer.TYPED_ARRAY_SUPPORT) {
78571 for (var i = 0; i < size; ++i) {
78572 that[i] = 0
78573 }
78574 }
78575 return that
78576}
78577
78578/**
78579 * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.

Callers 2

BufferFunction · 0.70
sanddance.jsFile · 0.70

Calls 3

assertSizeFunction · 0.70
createBufferFunction · 0.70
checkedFunction · 0.70

Tested by

no test coverage detected