mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-27 06:43:19 +08:00
An array constructed with a known element count of up to 16 (array literals, copies, slices and the arrays the runtime builds) keeps its slots in its own block, as empty arrays built for appends already do, so it costs one allocation and one free. scr_arr_make_ops is inlined into its two constructors, so the size class of scr_arr_new_ops_small folds to a table index. It writes the element ops id with the other header fields and records ops past the registry in the array's ext after the storage is set up: the ext pointer precedes the dense allocation, so inline slots must move out before the ext is created.