mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-21 05:50:55 +08:00
* Compile Effect generators statically * test: declare the dormant array write's expected fence
15 lines
331 B
JavaScript
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;
|
|
}
|