mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-31 07:23:06 +08:00
Publication (@scriptc/threads publish() and the zero-copy delivery of deeply frozen plain-data graphs) makes objects immortal: nothing frees them, and the RC audit already stops counting them. LeakSanitizer did not know, so a program that drops its last reference to a published graph reported every such object as a direct leak whenever leak detection was on (SCRIPTC_SAN=1 runs on Linux without ASAN_OPTIONS=detect_leaks=0, such as the documented local fallback). Both publication paths now mark each object they make immortal with the weak __lsan_ignore_object hook in ASan builds; ignored chunks are leak-scan roots, so the verdict on the rest of the heap is unchanged. Other builds compile the hook away. The sanitized lanes run with detect_leaks=0, so a harness test pins the contract with LeakSanitizer on (Linux, SCRIPTC_SAN=1 lane).