mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-12 02:13:04 +08:00
Each object a publish walks cost two calls out of its emitted walker: scr_pub_mark to mark and log it, and scr_pub_push for each reference it holds (a string field went through scr_pub_push to scr_pub_str_fn). The walkers now mark through ScrPub's leading fields: when the publish is not refused, the log has room, and the count fits the log's 32 bits, they write the log entry and SIZE_MAX themselves, and call scr_cyc_pub_take for a buffered candidate. Anything else, and every mark of an RC-audit build, still calls scr_pub_mark. References go onto the stack directly, with scr_pub_push only when it is full, and string fields call scr_pub_str_fn. ScrPub's fields are reordered so the walkers' fields come first; static assertions in scr_publish.c pin the offsets the walkers use.