Closed richarddd closed 2 months ago
Hi,
Is it any way to run gc from js? I currently have the code bellow, but since i wait for completion using: runtime.idle().await it holds a lock on the runtime meaning that below function will block waiting for that lock.
runtime.idle().await
ctx.globals().set( "__gc", Func::from(Async(move || { let runtime = rt2.clone(); async move { runtime.run_gc().await; } })), )?;
Found a work around by unsafely access the current runtime:
unsafe { let rt = qjs::JS_GetRuntime(ctx.as_raw().as_ptr()); qjs::JS_RunGC(rt); };
Hi,
Is it any way to run gc from js? I currently have the code bellow, but since i wait for completion using:
runtime.idle().await
it holds a lock on the runtime meaning that below function will block waiting for that lock.