Files
bun.sh/test/bun.js/gc.js
2022-09-30 01:04:10 -07:00

15 lines
316 B
JavaScript

export function gc() {
Bun.gc(true);
}
// we must ensure that finalizers are run
// so that the reference-counting logic is exercised
export function gcTick(trace = false) {
trace && console.trace("");
// console.trace("hello");
gc();
return new Promise((resolve) => {
setTimeout(resolve, 0);
});
}