mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-27 06:43:19 +08:00
When the last reference to an array dropped, the runtime ran the generic teardown: scr_rc_destroy's depth bookkeeping, an indirect call to the array destroy, and a loop over the element slots. Arrays of numbers, booleans and compact ProgramLifetime references release nothing, and neither do arrays of other ProgramLifetime instances, whose release does nothing. - scr_arr_release frees an acyclic array without an ext directly when its elements are numbers, booleans or compact references, or its descriptor has SCR_ARR_OPS_RELEASE_NOTHING. Every other array keeps the full teardown. - The backend sets SCR_ARR_OPS_RELEASE_NOTHING in the descriptor's flags word on 64-bit targets for ProgramLifetime element types that are not compact, plain or as the pointer arm of a nullable union, in programs without lifetime regions. Registration copies it into a table indexed by the descriptor's registry id before the id is published. Descriptors without the flag read 0 and keep the full teardown. Corpus 7401 drops arrays of ProgramLifetime instances, numbers and booleans through every array operation, with holes and far indices, next to arrays of ordinary objects, and matches Node.