Files
Chris Tate c257368c5e Compile Effect generators statically (#589)
* Compile Effect generators statically

* test: declare the dormant array write's expected fence
2026-09-30 14:25:29 -05:00

15 lines
331 B
JavaScript

function fill(out, start, end) {
if (end - start > 1) {
const middle = Math.floor((start + end) / 2);
fill(out, start, middle);
fill(out, middle, end);
} else if (start < end) {
out[start] = start * 2;
}
}
export function allocated(size) {
const out = new Array(size);
fill(out, 0, size);
return out;
}