Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion libquickjs-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ fn main() {
.flag_if_supported("-Wno-cast-function-type")
.flag_if_supported("-Wno-implicit-fallthrough")
.flag_if_supported("-Wno-enum-conversion")
.opt_level(0);
// The interpreter dispatch loop is the hottest code in every host;
// -O2 matches the official QuickJS Makefile. (This sat at -O0 from a
// 2021 bring-up experiment — a ~3-5x interpreter slowdown on MIPS.)
.opt_level(2);

if is_psp {
build
Expand Down
5 changes: 5 additions & 0 deletions libquickjs-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,11 @@ extern "C" {
/// immediately, never retain it. Used by the 3D host (gfx3d.rs) to read mesh
/// + command buffers handed down from JS.
pub fn JS_GetArrayBuffer(ctx: *mut JSContext, psize: *mut size_t, obj: JSValue) -> *mut u8;

/// Cycle-collector trigger threshold (bytes allocated since the last run;
/// refcounting reclaims acyclic garbage regardless). Default is 256 KB.
pub fn JS_SetGCThreshold(rt: *mut JSRuntime, gc_threshold: size_t);
pub fn JS_RunGC(rt: *mut JSRuntime);
}

/// Custom allocator hooks so QuickJS can use the host (Rust/PSP) allocator
Expand Down