@scriptc/cli-darwin-arm64 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/THIRD_PARTY_NOTICES +1 -1
- package/dist/bin/scriptc +0 -0
- package/dist/bin/scriptc.json +1 -1
- package/dist/lib/declarations/scriptc-node-fallback.d.ts +57 -30
- package/dist/lib/llvm/bin/scriptc-llvm-codegen +0 -0
- package/dist/lib/llvm/package.json +1 -1
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_async.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_child.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_context.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_dgram.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_events.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_fetch.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_file_handle.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_readline.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_shared.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_stream.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_tls.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_async.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_async_dyn.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_bigint.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_bigint_assert.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_child.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_console_native.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_context.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_copying.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_crypto_async.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_dc.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_dgram.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_dyn_handle.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_dyn_invoke.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_events.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_fetch.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_ffi.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_ffi_queue.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_file_handle.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_grapheme.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_http.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_http2.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_inspect.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_loop_epoll.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_loop_kqueue.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_loop_wsapoll.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_net.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_path.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_qs.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_readline.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_shared.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_stream.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_test.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_tls.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_tls_ca.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_url_params.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_util.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_util_compare.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_util_style.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_watch.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default-workers/scr_zlib.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_async.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_child.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_context.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_dgram.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_events.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_file_handle.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_island.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_readline.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_shared.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_stream.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_tls.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic-text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/text-decoder-legacy-workers/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/workers/scr_mailbox.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/workers/scr_message.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/workers/scr_worker.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/workers/scr_worker_events.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_context.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_shared.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_context.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_shared.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_context.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_copying.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_inspect.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_shared.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_zlib.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_context.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_copying.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_inspect.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_shared.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_zlib.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_async.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_child.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_context.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_dgram.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_events.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_fetch.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_file_handle.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_readline.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_shared.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_stream.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_tls.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_async.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_async_dyn.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_bigint.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_bigint_assert.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_child.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_console_native.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_context.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_copying.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_crypto_async.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_dc.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_dgram.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_dyn_handle.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_dyn_invoke.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_events.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_fetch.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_ffi.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_ffi_queue.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_file_handle.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_grapheme.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_http.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_http2.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_inspect.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_loop_epoll.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_loop_kqueue.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_loop_wsapoll.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_net.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_path.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_qs.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_readline.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_shared.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_stream.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_test.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_tls.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_tls_ca.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_url_params.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_util.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_util_compare.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_util_style.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_watch.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default-workers/scr_zlib.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_async.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_child.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_context.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_dgram.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_events.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_file_handle.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_island.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_readline.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_shared.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_stream.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_tls.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic-text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/text-decoder-legacy-workers/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/workers/scr_mailbox.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/workers/scr_message.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/workers/scr_worker.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/workers/scr_worker_events.o +0 -0
- package/dist/lib/runtime-darwin-arm64/package.json +1 -1
- package/dist/lib/runtime-darwin-arm64/runtime-pack.json +3300 -772
- package/dist/lib/runtime-sources/package.json +1 -1
- package/dist/lib/runtime-sources/src/scr_array.c +212 -40
- package/dist/lib/runtime-sources/src/scr_assert.c +3 -3
- package/dist/lib/runtime-sources/src/scr_async.c +401 -71
- package/dist/lib/runtime-sources/src/scr_async_dyn.c +30 -30
- package/dist/lib/runtime-sources/src/scr_bytes.c +50 -5
- package/dist/lib/runtime-sources/src/scr_bytes_io.c +47 -32
- package/dist/lib/runtime-sources/src/scr_child.c +48 -30
- package/dist/lib/runtime-sources/src/scr_closure.c +21 -11
- package/dist/lib/runtime-sources/src/scr_console.c +27 -5
- package/dist/lib/runtime-sources/src/scr_context.c +167 -0
- package/dist/lib/runtime-sources/src/scr_context.test.c +118 -0
- package/dist/lib/runtime-sources/src/scr_context.test.ts +47 -0
- package/dist/lib/runtime-sources/src/scr_copying.c +1 -0
- package/dist/lib/runtime-sources/src/scr_cycle.c +112 -12
- package/dist/lib/runtime-sources/src/scr_dc.c +8 -8
- package/dist/lib/runtime-sources/src/scr_dgram.c +10 -7
- package/dist/lib/runtime-sources/src/scr_error.c +26 -14
- package/dist/lib/runtime-sources/src/scr_events.c +45 -31
- package/dist/lib/runtime-sources/src/scr_events_emitter.c +34 -1
- package/dist/lib/runtime-sources/src/scr_exception.c +26 -7
- package/dist/lib/runtime-sources/src/scr_fetch.c +23 -20
- package/dist/lib/runtime-sources/src/scr_fetch_curl.c +1 -1
- package/dist/lib/runtime-sources/src/scr_ffi.c +3 -3
- package/dist/lib/runtime-sources/src/scr_file_handle.c +1 -0
- package/dist/lib/runtime-sources/src/scr_http.c +20 -16
- package/dist/lib/runtime-sources/src/scr_http2.c +10 -8
- package/dist/lib/runtime-sources/src/scr_inspect.c +1 -0
- package/dist/lib/runtime-sources/src/scr_island.c +1 -1
- package/dist/lib/runtime-sources/src/scr_json.c +179 -45
- package/dist/lib/runtime-sources/src/scr_json.test.c +16 -0
- package/dist/lib/runtime-sources/src/scr_json.test.ts +1 -0
- package/dist/lib/runtime-sources/src/scr_key.h +28 -4
- package/dist/lib/runtime-sources/src/scr_lib.c +124 -63
- package/dist/lib/runtime-sources/src/scr_mailbox.c +233 -0
- package/dist/lib/runtime-sources/src/scr_mailbox.h +28 -0
- package/dist/lib/runtime-sources/src/scr_mailbox.test.c +86 -0
- package/dist/lib/runtime-sources/src/scr_mailbox.test.ts +46 -0
- package/dist/lib/runtime-sources/src/scr_map.c +195 -46
- package/dist/lib/runtime-sources/src/scr_message.c +443 -0
- package/dist/lib/runtime-sources/src/scr_message.h +14 -0
- package/dist/lib/runtime-sources/src/scr_message.test.c +152 -0
- package/dist/lib/runtime-sources/src/scr_message.test.ts +44 -0
- package/dist/lib/runtime-sources/src/scr_net.c +14 -12
- package/dist/lib/runtime-sources/src/scr_number.c +34 -0
- package/dist/lib/runtime-sources/src/scr_object.c +9 -4
- package/dist/lib/runtime-sources/src/scr_path.c +1 -1
- package/dist/lib/runtime-sources/src/scr_readline.c +8 -8
- package/dist/lib/runtime-sources/src/scr_regex.c +113 -0
- package/dist/lib/runtime-sources/src/scr_runtime.h +170 -28
- package/dist/lib/runtime-sources/src/scr_shared.c +280 -0
- package/dist/lib/runtime-sources/src/scr_shared.test.c +113 -0
- package/dist/lib/runtime-sources/src/scr_shared.test.ts +45 -0
- package/dist/lib/runtime-sources/src/scr_stream.c +9 -9
- package/dist/lib/runtime-sources/src/scr_string.c +224 -113
- package/dist/lib/runtime-sources/src/scr_test.c +8 -8
- package/dist/lib/runtime-sources/src/scr_tls.c +12 -12
- package/dist/lib/runtime-sources/src/scr_tls_ca.c +34 -12
- package/dist/lib/runtime-sources/src/scr_union.c +10 -5
- package/dist/lib/runtime-sources/src/scr_util_compare.c +1 -0
- package/dist/lib/runtime-sources/src/scr_util_style.c +11 -11
- package/dist/lib/runtime-sources/src/scr_watch.c +16 -6
- package/dist/lib/runtime-sources/src/scr_worker.c +232 -0
- package/dist/lib/runtime-sources/src/scr_worker.h +42 -0
- package/dist/lib/runtime-sources/src/scr_worker.test.c +115 -0
- package/dist/lib/runtime-sources/src/scr_worker.test.ts +49 -0
- package/dist/lib/runtime-sources/src/scr_worker_events.c +443 -0
- package/dist/lib/runtime-sources/src/scr_zlib.c +6 -0
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#include "scr_runtime.h"
|
|
2
|
+
#include "scr_key.h"
|
|
2
3
|
|
|
3
4
|
#include <math.h>
|
|
4
5
|
#include <stdio.h>
|
|
@@ -88,17 +89,25 @@ static SCR_TL ScrSidx scr_sidx_sparse_tab[SCR_SIDX_N];
|
|
|
88
89
|
static SCR_TL ScrSidx scr_sidx_cursor_tab[SCR_SIDX_N];
|
|
89
90
|
static SCR_TL unsigned scr_sidx_sparse_clock;
|
|
90
91
|
static SCR_TL unsigned scr_sidx_cursor_clock;
|
|
92
|
+
static SCR_TL unsigned scr_sidx_sparse_live;
|
|
91
93
|
static SCR_TL bool scr_sidx_cleanup_registered;
|
|
94
|
+
/* Counts both tiers, independent of the wrapping eviction clocks. A transfer
|
|
95
|
+
* moves one active entry; only clearing or initializing changes the count. */
|
|
96
|
+
static SCR_TL size_t scr_sidx_active;
|
|
92
97
|
|
|
93
|
-
static void scr_sidx_clear(ScrSidx *e) {
|
|
98
|
+
static void scr_sidx_clear(ScrSidx *e, unsigned *live) {
|
|
99
|
+
if (e->s) {
|
|
100
|
+
scr_sidx_active--;
|
|
101
|
+
if (live) (*live)--;
|
|
102
|
+
}
|
|
94
103
|
free(e->points);
|
|
95
104
|
memset(e, 0, sizeof(*e));
|
|
96
105
|
}
|
|
97
106
|
|
|
98
107
|
static void scr_sidx_reset_all(void) {
|
|
99
108
|
for (int i = 0; i < SCR_SIDX_N; i++) {
|
|
100
|
-
scr_sidx_clear(&scr_sidx_sparse_tab[i]);
|
|
101
|
-
scr_sidx_clear(&scr_sidx_cursor_tab[i]);
|
|
109
|
+
scr_sidx_clear(&scr_sidx_sparse_tab[i], &scr_sidx_sparse_live);
|
|
110
|
+
scr_sidx_clear(&scr_sidx_cursor_tab[i], NULL);
|
|
102
111
|
}
|
|
103
112
|
scr_sidx_sparse_clock = 0;
|
|
104
113
|
scr_sidx_cursor_clock = 0;
|
|
@@ -121,6 +130,7 @@ void scr_sidx_test_reset_steps(void) {
|
|
|
121
130
|
size_t scr_sidx_test_walk_steps(void) { return scr_sidx_walk_steps; }
|
|
122
131
|
size_t scr_sidx_test_searches(void) { return scr_sidx_searches; }
|
|
123
132
|
void scr_sidx_test_reset_cache(void) { scr_sidx_reset_all(); }
|
|
133
|
+
size_t scr_sidx_test_active(void) { return scr_sidx_active; }
|
|
124
134
|
size_t scr_sidx_test_entries(void) {
|
|
125
135
|
size_t n = 0;
|
|
126
136
|
for (int i = 0; i < SCR_SIDX_N; i++)
|
|
@@ -140,24 +150,48 @@ size_t scr_sidx_test_points(void) {
|
|
|
140
150
|
#define SCR_SIDX_SEARCH() ((void)0)
|
|
141
151
|
#endif
|
|
142
152
|
|
|
143
|
-
|
|
153
|
+
/* Share cleanup across release and scratch reuse; callers inline only the
|
|
154
|
+
* empty-cache check. */
|
|
155
|
+
static __attribute__((noinline)) void scr_sidx_purge_active(const ScrStr *s) {
|
|
144
156
|
/* These are deliberately fixed four-entry tables, never an unbounded
|
|
145
157
|
* receiver registry. Releasing an unrelated temporary therefore does at
|
|
146
158
|
* most eight pointer comparisons and cannot grow with live strings. */
|
|
147
159
|
for (int i = 0; i < SCR_SIDX_N; i++) {
|
|
148
160
|
if (scr_sidx_sparse_tab[i].s == s)
|
|
149
|
-
scr_sidx_clear(&scr_sidx_sparse_tab[i]);
|
|
161
|
+
scr_sidx_clear(&scr_sidx_sparse_tab[i], &scr_sidx_sparse_live);
|
|
150
162
|
if (scr_sidx_cursor_tab[i].s == s)
|
|
151
|
-
scr_sidx_clear(&scr_sidx_cursor_tab[i]);
|
|
163
|
+
scr_sidx_clear(&scr_sidx_cursor_tab[i], NULL);
|
|
152
164
|
}
|
|
153
165
|
}
|
|
154
166
|
|
|
155
|
-
static void
|
|
167
|
+
static void scr_sidx_purge(const ScrStr *s) {
|
|
168
|
+
if (scr_sidx_active) scr_sidx_purge_active(s);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
static void scr_sidx_init(ScrSidx *e, const ScrStr *s, unsigned *live) {
|
|
156
172
|
memset(e, 0, sizeof(*e));
|
|
157
173
|
e->s = s;
|
|
174
|
+
scr_sidx_active++;
|
|
175
|
+
if (live) (*live)++;
|
|
158
176
|
e->u16len = SCR_U16_UNKNOWN;
|
|
159
177
|
}
|
|
160
178
|
|
|
179
|
+
/* Reuse sparse-tier holes left by short-lived receivers before evicting a live index.
|
|
180
|
+
* Round-robin eviction remains bounded when every slot is occupied. */
|
|
181
|
+
static ScrSidx *scr_sidx_claim(ScrSidx *table, unsigned *clock, unsigned *live) {
|
|
182
|
+
/* A full tier needs no second slot scan after the failed lookup. */
|
|
183
|
+
for (size_t offset = 0; *live < SCR_SIDX_N && offset < SCR_SIDX_N; offset++) {
|
|
184
|
+
size_t index = (*clock + offset) % SCR_SIDX_N;
|
|
185
|
+
if (!table[index].s) {
|
|
186
|
+
*clock = (unsigned)(index + 1);
|
|
187
|
+
return &table[index];
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
ScrSidx *entry = &table[(*clock)++ % SCR_SIDX_N];
|
|
191
|
+
scr_sidx_clear(entry, live);
|
|
192
|
+
return entry;
|
|
193
|
+
}
|
|
194
|
+
|
|
161
195
|
/* Short strings retain the historical hot cursor without contending with the
|
|
162
196
|
* sparse residency. Large strings claim only the sparse tier; an in-place
|
|
163
197
|
* append that crosses the threshold moves its exact cursor frontier into
|
|
@@ -178,17 +212,14 @@ static ScrSidx *scr_sidx(const ScrStr *s) {
|
|
|
178
212
|
for (int i = 0; i < SCR_SIDX_N; i++) {
|
|
179
213
|
ScrSidx *old = &scr_sidx_cursor_tab[i];
|
|
180
214
|
if (old->s != s) continue;
|
|
181
|
-
ScrSidx *e = &
|
|
182
|
-
scr_sidx_sparse_clock++ % SCR_SIDX_N];
|
|
183
|
-
scr_sidx_clear(e);
|
|
215
|
+
ScrSidx *e = scr_sidx_claim(scr_sidx_sparse_tab, &scr_sidx_sparse_clock, &scr_sidx_sparse_live);
|
|
184
216
|
*e = *old;
|
|
217
|
+
scr_sidx_sparse_live++;
|
|
185
218
|
memset(old, 0, sizeof(*old)); /* ownership moved to the sparse tier */
|
|
186
219
|
return e;
|
|
187
220
|
}
|
|
188
|
-
ScrSidx *e =
|
|
189
|
-
|
|
190
|
-
scr_sidx_clear(e);
|
|
191
|
-
scr_sidx_init(e, s);
|
|
221
|
+
ScrSidx *e = scr_sidx_claim(scr_sidx_sparse_tab, &scr_sidx_sparse_clock, &scr_sidx_sparse_live);
|
|
222
|
+
scr_sidx_init(e, s, &scr_sidx_sparse_live);
|
|
192
223
|
return e;
|
|
193
224
|
}
|
|
194
225
|
ScrSidx *tab = scr_sidx_cursor_tab;
|
|
@@ -197,8 +228,8 @@ static ScrSidx *scr_sidx(const ScrStr *s) {
|
|
|
197
228
|
if (tab[i].s == s) return &tab[i];
|
|
198
229
|
}
|
|
199
230
|
ScrSidx *e = &tab[(*clock)++ % SCR_SIDX_N];
|
|
200
|
-
scr_sidx_clear(e);
|
|
201
|
-
scr_sidx_init(e, s);
|
|
231
|
+
scr_sidx_clear(e, NULL);
|
|
232
|
+
scr_sidx_init(e, s, NULL);
|
|
202
233
|
return e;
|
|
203
234
|
}
|
|
204
235
|
|
|
@@ -208,6 +239,7 @@ static ScrSidx *scr_sidx(const ScrStr *s) {
|
|
|
208
239
|
* receiver may move from the cursor tier to the sparse tier on its next
|
|
209
240
|
* lookup, so invalidate either possible entry. */
|
|
210
241
|
static void scr_sidx_concat_append(const ScrStr *s, size_t oldlen) {
|
|
242
|
+
if (scr_sidx_active == 0) return;
|
|
211
243
|
for (int i = 0; i < SCR_SIDX_N; i++) {
|
|
212
244
|
ScrSidx *entries[] = {&scr_sidx_sparse_tab[i], &scr_sidx_cursor_tab[i]};
|
|
213
245
|
for (size_t j = 0; j < sizeof(entries) / sizeof(entries[0]); j++) {
|
|
@@ -381,7 +413,7 @@ ScrStr *scr_str_concat_parts(ScrStr *const *parts, size_t count) {
|
|
|
381
413
|
}
|
|
382
414
|
|
|
383
415
|
bool scr_str_eq(ScrStr *a, ScrStr *b) {
|
|
384
|
-
return a == b || (a->len == b->len &&
|
|
416
|
+
return a == b || (a->len == b->len && scr_key_equal(a->data, b->data, a->len));
|
|
385
417
|
}
|
|
386
418
|
|
|
387
419
|
int scr_str_cmp(ScrStr *a, ScrStr *b) {
|
|
@@ -391,62 +423,29 @@ int scr_str_cmp(ScrStr *a, ScrStr *b) {
|
|
|
391
423
|
return a->len < b->len ? -1 : (a->len > b->len ? 1 : 0);
|
|
392
424
|
}
|
|
393
425
|
|
|
394
|
-
/* UTF-16
|
|
395
|
-
*
|
|
396
|
-
*
|
|
397
|
-
*
|
|
398
|
-
*
|
|
399
|
-
* Decode code points and compare their leading UTF-16 units. */
|
|
400
|
-
static uint32_t scr_str_lead_u16(const unsigned char *s, size_t len,
|
|
401
|
-
size_t *adv) {
|
|
402
|
-
unsigned char b = s[0];
|
|
403
|
-
uint32_t cp;
|
|
404
|
-
size_t n;
|
|
405
|
-
if (b < 0x80) {
|
|
406
|
-
cp = b; n = 1;
|
|
407
|
-
} else if ((b & 0xe0) == 0xc0) {
|
|
408
|
-
cp = b & 0x1fu; n = 2;
|
|
409
|
-
} else if ((b & 0xf0) == 0xe0) {
|
|
410
|
-
cp = b & 0x0fu; n = 3;
|
|
411
|
-
} else {
|
|
412
|
-
cp = b & 0x07u; n = 4;
|
|
413
|
-
}
|
|
414
|
-
if (n > len) n = len; /* defensive: strings are well-formed by contract */
|
|
415
|
-
for (size_t i = 1; i < n; i++) cp = (cp << 6) | (s[i] & 0x3fu);
|
|
416
|
-
*adv = n;
|
|
417
|
-
if (cp >= 0x10000) return 0xd800 + ((cp - 0x10000) >> 10);
|
|
418
|
-
return cp;
|
|
419
|
-
}
|
|
420
|
-
|
|
426
|
+
/* UTF-16 ordering over well-formed UTF-8. Equal bytes can be skipped even
|
|
427
|
+
* inside a multibyte character: unequal continuation bytes preserve code
|
|
428
|
+
* point order. Only differing lead bytes for U+E000..U+FFFF versus a
|
|
429
|
+
* supplementary character reverse byte order, because the latter starts
|
|
430
|
+
* with a UTF-16 high surrogate below U+E000. */
|
|
421
431
|
int scr_str_cmp_u16(ScrStr *a, ScrStr *b) {
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
if (
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
(i == 0 ? (unsigned char)b->data[ib] & 0x07u
|
|
440
|
-
: (unsigned char)b->data[ib + i] & 0x3fu);
|
|
441
|
-
}
|
|
442
|
-
if (cpa != cpb) return cpa < cpb ? -1 : 1;
|
|
443
|
-
}
|
|
444
|
-
ia += na;
|
|
445
|
-
ib += nb;
|
|
446
|
-
}
|
|
447
|
-
if (ia < a->len) return 1;
|
|
448
|
-
if (ib < b->len) return -1;
|
|
449
|
-
return 0;
|
|
432
|
+
if (a == b) return 0;
|
|
433
|
+
size_t common = a->len < b->len ? a->len : b->len;
|
|
434
|
+
size_t i = 0;
|
|
435
|
+
while (common - i >= sizeof(uint64_t)) {
|
|
436
|
+
uint64_t left, right;
|
|
437
|
+
memcpy(&left, a->data + i, sizeof(left));
|
|
438
|
+
memcpy(&right, b->data + i, sizeof(right));
|
|
439
|
+
if (left != right) break;
|
|
440
|
+
i += sizeof(left);
|
|
441
|
+
}
|
|
442
|
+
while (i < common && a->data[i] == b->data[i]) i++;
|
|
443
|
+
if (i == common) return (a->len > b->len) - (a->len < b->len);
|
|
444
|
+
unsigned char left = (unsigned char)a->data[i];
|
|
445
|
+
unsigned char right = (unsigned char)b->data[i];
|
|
446
|
+
if (left >= 0xf0 && right >= 0xee && right <= 0xef) return -1;
|
|
447
|
+
if (right >= 0xf0 && left >= 0xee && left <= 0xef) return 1;
|
|
448
|
+
return left < right ? -1 : 1;
|
|
450
449
|
}
|
|
451
450
|
|
|
452
451
|
/* ── interned strings ─────────────────────────────────────────────────
|
|
@@ -1178,9 +1177,43 @@ ScrStr *scr_str_slice(ScrStr *s, double start, double end) {
|
|
|
1178
1177
|
return scr_str_slice_units(s, e, from, to);
|
|
1179
1178
|
}
|
|
1180
1179
|
|
|
1180
|
+
void scr_str_slice_range(ScrStr *s, double start, double end, bool substring,
|
|
1181
|
+
ScrStringSlice *out) {
|
|
1182
|
+
ScrSidx *e = scr_sidx(s);
|
|
1183
|
+
size_t length = scr_sidx_len(s, e);
|
|
1184
|
+
double a = scr_to_integer_or_infinity(start), b = scr_to_integer_or_infinity(end);
|
|
1185
|
+
size_t from, to;
|
|
1186
|
+
if (substring) {
|
|
1187
|
+
from = a <= 0 ? 0 : a >= (double)length ? length : (size_t)a;
|
|
1188
|
+
to = b <= 0 ? 0 : b >= (double)length ? length : (size_t)b;
|
|
1189
|
+
if (from > to) { size_t swap = from; from = to; to = swap; }
|
|
1190
|
+
} else {
|
|
1191
|
+
from = scr_slice_boundary(a, length);
|
|
1192
|
+
to = scr_slice_boundary(b, length);
|
|
1193
|
+
}
|
|
1194
|
+
out->start = from;
|
|
1195
|
+
out->length = to > from ? to - from : 0;
|
|
1196
|
+
out->split = 0;
|
|
1197
|
+
if (out->length) {
|
|
1198
|
+
bool first, last;
|
|
1199
|
+
(void)scr_u16_to_byte_c(s, e, from, &first);
|
|
1200
|
+
(void)scr_u16_to_byte_c(s, e, to, &last);
|
|
1201
|
+
out->split = (first ? 1u : 0u) | (last ? 2u : 0u);
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
double scr_str_slice_char_code_at(ScrStr *s, const ScrStringSlice *range, double index) {
|
|
1206
|
+
double unit = scr_to_integer_or_infinity(index);
|
|
1207
|
+
if (!(unit >= 0) || unit >= (double)range->length) return NAN;
|
|
1208
|
+
if ((unit == 0 && (range->split & 1u)) ||
|
|
1209
|
+
(unit == (double)(range->length - 1) && (range->split & 2u))) return 0xFFFD;
|
|
1210
|
+
return scr_str_char_code_at(s, (double)range->start + unit);
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1181
1213
|
static ScrStr *scr_str_slice_units(ScrStr *s, ScrSidx *e,
|
|
1182
1214
|
size_t from, size_t to) {
|
|
1183
1215
|
if (from >= to) return scr_str_empty();
|
|
1216
|
+
if (from == 0 && to == e->u16len) return scr_str_retain(s);
|
|
1184
1217
|
|
|
1185
1218
|
bool from_mid, to_mid;
|
|
1186
1219
|
size_t from_b = scr_u16_to_byte_c(s, e, from, &from_mid);
|
|
@@ -1190,8 +1223,14 @@ static ScrStr *scr_str_slice_units(ScrStr *s, ScrSidx *e,
|
|
|
1190
1223
|
size_t content_b = from_mid ? from_b + 4 : from_b;
|
|
1191
1224
|
size_t content_len = to_b - content_b;
|
|
1192
1225
|
|
|
1193
|
-
if (!from_mid && !to_mid)
|
|
1194
|
-
|
|
1226
|
+
if (!from_mid && !to_mid) {
|
|
1227
|
+
ScrStr *result = scr_str_from_span(s->data + from_b, content_len);
|
|
1228
|
+
/* Unit boundaries already prove the exact output length. Preserve it
|
|
1229
|
+
* instead of decoding a potentially megabyte-sized copy on .length.
|
|
1230
|
+
* Index checkpoints remain lazy and owned by the result's cache slot. */
|
|
1231
|
+
if (content_len >= SCR_SIDX_MIN_BYTES) scr_sidx(result)->u16len = to - from;
|
|
1232
|
+
return result;
|
|
1233
|
+
}
|
|
1195
1234
|
|
|
1196
1235
|
/* Divergence: JS would emit the lone surrogate half; we emit U+FFFD. */
|
|
1197
1236
|
size_t total = content_len + (from_mid ? SCR_REPLACEMENT_LEN : 0) +
|
|
@@ -1317,15 +1356,6 @@ static const struct { size_t rc; size_t len; size_t cap; char data[4]; }
|
|
|
1317
1356
|
/* Split owns a fresh array and appends only present string values. Fill an
|
|
1318
1357
|
* available dense slot directly; ordinary push handles growth and the sparse
|
|
1319
1358
|
* boundary. The array remains valid after every append, including RC audit. */
|
|
1320
|
-
static void scr_str_split_append(ScrArr *out, ScrStr *value) {
|
|
1321
|
-
if (out->len < out->cap) {
|
|
1322
|
-
out->data[out->len] = (uint64_t)(uintptr_t)value;
|
|
1323
|
-
out->present[out->len++] = SCR_ARR_VALUE;
|
|
1324
|
-
} else {
|
|
1325
|
-
scr_arr_push_ref(out, value);
|
|
1326
|
-
}
|
|
1327
|
-
}
|
|
1328
|
-
|
|
1329
1359
|
/* split(separator, limit) with a STRING separator (ECMA-262 22.1.3.23):
|
|
1330
1360
|
* limit is ToUint32'd; zero returns [] and reaching the limit stops before
|
|
1331
1361
|
* any later separator probes. The no-limit wrapper supplies 2^32-1.
|
|
@@ -1338,38 +1368,119 @@ static void scr_str_split_append(ScrArr *out, ScrStr *value) {
|
|
|
1338
1368
|
* yield the two lone surrogate halves, each half is U+FFFD here
|
|
1339
1369
|
* (divergence 2 — the same substitution the island's boundary marshal
|
|
1340
1370
|
* applied). Borrows both; returns a +1 string[]. */
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1371
|
+
void scr_str_split_cursor_init(ScrSplitCursor *cursor, uint32_t limit) {
|
|
1372
|
+
cursor->offset = 0;
|
|
1373
|
+
cursor->remaining = limit;
|
|
1374
|
+
cursor->pending_unit = 0;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
static ScrStr *scr_str_split_piece(const char *bytes, size_t len, ScrStr **scratch) {
|
|
1378
|
+
if (!scratch || len <= 4) return scr_str_from_span(bytes, len);
|
|
1379
|
+
ScrStr *piece = *scratch;
|
|
1380
|
+
if (piece && piece->rc == 1 && piece->cap >= len) {
|
|
1381
|
+
/* The scratch owner is the only remaining reference. Invalidate all
|
|
1382
|
+
* metadata before replacing bytes, just as unique concatenation does. */
|
|
1383
|
+
scr_short_forget(piece);
|
|
1384
|
+
scr_sidx_purge(piece);
|
|
1385
|
+
memcpy(piece->data, bytes, len);
|
|
1386
|
+
piece->len = len;
|
|
1387
|
+
piece->data[len] = '\0';
|
|
1388
|
+
} else {
|
|
1389
|
+
ScrStr *fresh = scr_str_alloc_raw(len, len < 64 ? 64 : len);
|
|
1390
|
+
memcpy(fresh->data, bytes, len);
|
|
1391
|
+
fresh->data[len] = '\0';
|
|
1392
|
+
*scratch = fresh;
|
|
1393
|
+
scr_str_release(piece);
|
|
1394
|
+
piece = fresh;
|
|
1395
|
+
}
|
|
1396
|
+
return scr_str_retain(piece);
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
/* Both eager and loop consumers use the same boundary state machine.
|
|
1400
|
+
* Eager consumers select the unit/substring path once before their loop. */
|
|
1401
|
+
static const char *scr_str_split_span(ScrStr *s, ScrStr *sep,
|
|
1402
|
+
ScrSplitCursor *cursor, bool units,
|
|
1403
|
+
size_t *len) {
|
|
1404
|
+
if (cursor->remaining == 0 || cursor->offset > s->len) return NULL;
|
|
1405
|
+
if (units) {
|
|
1406
|
+
if (cursor->pending_unit) {
|
|
1407
|
+
cursor->pending_unit = 0;
|
|
1408
|
+
cursor->remaining--;
|
|
1409
|
+
*len = 3;
|
|
1410
|
+
return scr_lit_fffd.data;
|
|
1359
1411
|
}
|
|
1360
|
-
return
|
|
1361
|
-
|
|
1362
|
-
|
|
1412
|
+
if (cursor->offset == s->len) return NULL;
|
|
1413
|
+
size_t start = cursor->offset, adv;
|
|
1414
|
+
uint32_t cp = scr_utf8_decode(s->data + start, &adv);
|
|
1415
|
+
cursor->offset += adv;
|
|
1416
|
+
cursor->remaining--;
|
|
1417
|
+
if (cp >= 0x10000) {
|
|
1418
|
+
cursor->pending_unit = 1;
|
|
1419
|
+
*len = 3;
|
|
1420
|
+
return scr_lit_fffd.data;
|
|
1421
|
+
}
|
|
1422
|
+
*len = adv;
|
|
1423
|
+
return s->data + start;
|
|
1424
|
+
}
|
|
1425
|
+
size_t start = cursor->offset;
|
|
1426
|
+
const char *found = scr_byte_find(s->data + start, s->len - start,
|
|
1427
|
+
sep->data, sep->len);
|
|
1428
|
+
size_t end = found ? (size_t)(found - s->data) : s->len;
|
|
1429
|
+
/* String allocations reserve the header and terminator, so len + 1
|
|
1430
|
+
* cannot overflow. This sentinel includes a final empty trailing piece. */
|
|
1431
|
+
cursor->offset = found ? end + sep->len : s->len + 1;
|
|
1432
|
+
cursor->remaining--;
|
|
1433
|
+
*len = end - start;
|
|
1434
|
+
return s->data + start;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
/* The source snapshot owns these bytes through the current iteration.
|
|
1438
|
+
* A consumer that stores or otherwise exposes the piece materializes it
|
|
1439
|
+
* with ordinary string ownership instead. */
|
|
1440
|
+
const char *scr_str_split_cursor_span(ScrStr *s, ScrStr *sep, ScrSplitCursor *cursor,
|
|
1441
|
+
size_t *length) {
|
|
1442
|
+
return scr_str_split_span(s, sep, cursor, sep->len == 0, length);
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
ScrStr *scr_str_split_materialize(const char *bytes, size_t length, ScrStr **scratch) {
|
|
1446
|
+
return scr_str_split_piece(bytes, length, scratch);
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
ScrStr *scr_str_split_cursor_next(ScrStr *s, ScrStr *sep, ScrSplitCursor *cursor,
|
|
1450
|
+
ScrStr **scratch) {
|
|
1451
|
+
size_t len;
|
|
1452
|
+
const char *bytes = scr_str_split_span(s, sep, cursor, sep->len == 0, &len);
|
|
1453
|
+
if (!bytes) return NULL;
|
|
1454
|
+
if (bytes == scr_lit_fffd.data) return scr_str_retain((ScrStr *)&scr_lit_fffd);
|
|
1455
|
+
return scr_str_split_piece(bytes, len, scratch);
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
/* Move a bounded batch of pieces into array storage in one operation.
|
|
1459
|
+
* This avoids a second separator scan and preserves sparse overflow. */
|
|
1460
|
+
static void scr_str_split_fill(ScrArr *out, ScrStr *s, ScrStr *sep,
|
|
1461
|
+
ScrSplitCursor *cursor, bool units) {
|
|
1462
|
+
uint64_t slots[64];
|
|
1363
1463
|
for (;;) {
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1464
|
+
size_t count = 0, len;
|
|
1465
|
+
const char *bytes;
|
|
1466
|
+
while (count < 64 && (bytes = scr_str_split_span(s, sep, cursor, units, &len))) {
|
|
1467
|
+
ScrStr *piece = bytes == scr_lit_fffd.data
|
|
1468
|
+
? scr_str_retain((ScrStr *)&scr_lit_fffd)
|
|
1469
|
+
: scr_str_from_span(bytes, len);
|
|
1470
|
+
slots[count++] = (uint64_t)(uintptr_t)piece;
|
|
1471
|
+
}
|
|
1472
|
+
if (count) scr_arr_push_many(out, count, slots);
|
|
1473
|
+
if (count < 64) return;
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
ScrArr *scr_str_split_limit(ScrStr *s, ScrStr *sep, double limit_num) {
|
|
1478
|
+
uint32_t limit = scr_to_uint32(limit_num);
|
|
1479
|
+
ScrArr *out = scr_arr_new(SCR_ELEM_STR, 0);
|
|
1480
|
+
ScrSplitCursor cursor;
|
|
1481
|
+
scr_str_split_cursor_init(&cursor, limit);
|
|
1482
|
+
if (sep->len == 0) scr_str_split_fill(out, s, sep, &cursor, true);
|
|
1483
|
+
else scr_str_split_fill(out, s, sep, &cursor, false);
|
|
1373
1484
|
return out;
|
|
1374
1485
|
}
|
|
1375
1486
|
|
|
@@ -100,19 +100,19 @@ struct ScrTestCtx {
|
|
|
100
100
|
ScrTestHooks hooks[4]; /* suites and root only */
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
-
static ScrTestCtx *scr_test_root = NULL;
|
|
103
|
+
static SCR_TL ScrTestCtx *scr_test_root = NULL;
|
|
104
104
|
/* Where registrations attach: the suite body being collected or the test
|
|
105
105
|
* currently running (its nested test()/t.test() calls are subtests). */
|
|
106
|
-
static ScrTestCtx *scr_test_reg_parent = NULL;
|
|
107
|
-
static bool scr_test_runner_spawned = false;
|
|
108
|
-
static bool scr_test_run_done = false;
|
|
109
|
-
static long scr_test_ct_tests = 0, scr_test_ct_suites = 0, scr_test_ct_pass = 0,
|
|
106
|
+
static SCR_TL ScrTestCtx *scr_test_reg_parent = NULL;
|
|
107
|
+
static SCR_TL bool scr_test_runner_spawned = false;
|
|
108
|
+
static SCR_TL bool scr_test_run_done = false;
|
|
109
|
+
static SCR_TL long scr_test_ct_tests = 0, scr_test_ct_suites = 0, scr_test_ct_pass = 0,
|
|
110
110
|
scr_test_ct_fail = 0, scr_test_ct_skipped = 0, scr_test_ct_todo = 0;
|
|
111
|
-
static double scr_test_t0 = 0;
|
|
112
|
-
static bool scr_test_suite_hook_failed = false;
|
|
111
|
+
static SCR_TL double scr_test_t0 = 0;
|
|
112
|
+
static SCR_TL bool scr_test_suite_hook_failed = false;
|
|
113
113
|
|
|
114
114
|
#ifdef SCR_RC_AUDIT
|
|
115
|
-
static long scr_testctx_live = 0;
|
|
115
|
+
static SCR_TL long scr_testctx_live = 0;
|
|
116
116
|
long scr_testctx_live_count(void) { return scr_testctx_live; }
|
|
117
117
|
#endif
|
|
118
118
|
|
|
@@ -141,9 +141,9 @@ static ssize_t scr_tls_w32_write(int fd, const void *buf, size_t len) {
|
|
|
141
141
|
|
|
142
142
|
/* ── the unit RNG (one CTR_DRBG, lazily seeded) ──────────────────────── */
|
|
143
143
|
|
|
144
|
-
static mbedtls_entropy_context scr_tls_entropy;
|
|
145
|
-
static mbedtls_ctr_drbg_context scr_tls_drbg;
|
|
146
|
-
static bool scr_tls_rng_ready = false;
|
|
144
|
+
static SCR_TL mbedtls_entropy_context scr_tls_entropy;
|
|
145
|
+
static SCR_TL mbedtls_ctr_drbg_context scr_tls_drbg;
|
|
146
|
+
static SCR_TL bool scr_tls_rng_ready = false;
|
|
147
147
|
|
|
148
148
|
/* Defined with the dyn-member hooks at the tail of this file; registered
|
|
149
149
|
* from rng_init so every TLS entry point installs the TLSSocket member
|
|
@@ -206,7 +206,7 @@ struct ScrSecureCtx {
|
|
|
206
206
|
};
|
|
207
207
|
|
|
208
208
|
#ifdef SCR_RC_AUDIT
|
|
209
|
-
static long scr_live_secure_ctx = 0;
|
|
209
|
+
static SCR_TL long scr_live_secure_ctx = 0;
|
|
210
210
|
long scr_secure_ctx_live_count(void) { return scr_live_secure_ctx; }
|
|
211
211
|
#endif
|
|
212
212
|
|
|
@@ -345,16 +345,16 @@ typedef struct ScrTlsCli {
|
|
|
345
345
|
* first (macOS ships it; Alpine links it), then Debian/Ubuntu's
|
|
346
346
|
* ca-certificates.crt, Fedora/RHEL's ca-bundle.crt, and openSUSE's
|
|
347
347
|
* ca-bundle.pem. */
|
|
348
|
-
static mbedtls_x509_crt scr_tls_system_roots;
|
|
349
|
-
static bool scr_tls_system_roots_loaded = false;
|
|
348
|
+
static SCR_TL mbedtls_x509_crt scr_tls_system_roots;
|
|
349
|
+
static SCR_TL bool scr_tls_system_roots_loaded = false;
|
|
350
350
|
|
|
351
351
|
/* setDefaultCACertificates' replacement anchors (scr_tls_ca.c — always
|
|
352
352
|
* compiled alongside this unit): parsed lazily per generation, so each
|
|
353
353
|
* set re-parses once and every later dial reuses the chain. An EMPTY
|
|
354
354
|
* replacement keeps an initialized, certificate-free chain — every
|
|
355
355
|
* verification fails, Node's own consequence of trusting nothing. */
|
|
356
|
-
static mbedtls_x509_crt scr_tls_override_roots;
|
|
357
|
-
static uint64_t scr_tls_override_parsed_gen = 0;
|
|
356
|
+
static SCR_TL mbedtls_x509_crt scr_tls_override_roots;
|
|
357
|
+
static SCR_TL uint64_t scr_tls_override_parsed_gen = 0;
|
|
358
358
|
|
|
359
359
|
#ifdef _WIN32
|
|
360
360
|
static void scr_tls_add_windows_ca(void *ctx, const unsigned char *der, size_t len) {
|
|
@@ -633,7 +633,7 @@ static void scr_tls_verify_msg(ScrTlsSock *t, char *out, size_t n) {
|
|
|
633
633
|
/* The socket whose handshake this unit is driving — f_sni's route back
|
|
634
634
|
* to the answered context (single-threaded runtime; set around
|
|
635
635
|
* mbedtls_ssl_handshake). */
|
|
636
|
-
static ScrTlsSock *scr_tls_current = NULL;
|
|
636
|
+
static SCR_TL ScrTlsSock *scr_tls_current = NULL;
|
|
637
637
|
|
|
638
638
|
/* Defined with the other transport ops below; the answer path needs the
|
|
639
639
|
* table's identity to re-find its engine from the boxed socket. */
|
|
@@ -1105,7 +1105,7 @@ static ScrBytes *scr_tls_pem_dyn(const ScrDyn *v, const char *what, bool concat)
|
|
|
1105
1105
|
memcpy(b->data, v->v.str->data, v->v.str->len);
|
|
1106
1106
|
return b;
|
|
1107
1107
|
}
|
|
1108
|
-
if (scr_dyn_bytes_is(v, SCR_BYTES_U8)) return scr_dyn_bytes_unbox(v);
|
|
1108
|
+
if (scr_dyn_bytes_is(v, SCR_BYTES_U8)) return v->v.bytes->shared ? scr_bytes_copy(v->v.bytes) : scr_dyn_bytes_unbox(v);
|
|
1109
1109
|
if (v->kind == SCR_DYN_ARR) {
|
|
1110
1110
|
if (v->v.arr.len == 0) {
|
|
1111
1111
|
ScrJsonBuf b;
|
|
@@ -1138,9 +1138,9 @@ static ScrBytes *scr_tls_pem_dyn(const ScrDyn *v, const char *what, bool concat)
|
|
|
1138
1138
|
size_t off = 0;
|
|
1139
1139
|
for (size_t i = 0; i < v->v.arr.len; i++) {
|
|
1140
1140
|
const ScrDyn *e = v->v.arr.items[i];
|
|
1141
|
-
const char *p = e->kind == SCR_DYN_STR ? e->v.str->data : (const char *)e->v.bytes->data;
|
|
1142
1141
|
size_t n = e->kind == SCR_DYN_STR ? e->v.str->len : e->v.bytes->len;
|
|
1143
|
-
memcpy(b->data + off,
|
|
1142
|
+
if (e->kind == SCR_DYN_STR) memcpy(b->data + off, e->v.str->data, n);
|
|
1143
|
+
else scr_bytes_read(e->v.bytes, 0, b->data + off, n);
|
|
1144
1144
|
off += n;
|
|
1145
1145
|
b->data[off++] = '\n'; /* PEM blocks join on line boundaries */
|
|
1146
1146
|
}
|
|
@@ -33,16 +33,23 @@
|
|
|
33
33
|
/* The per-type caches: +1 held here for the process lifetime (an atexit
|
|
34
34
|
* teardown releases them so the RC audit stays clean). 'default' also
|
|
35
35
|
* keeps the concatenated PEM buffer scr_tls.c parses into anchors. */
|
|
36
|
-
static ScrArr *scr_ca_bundled = NULL;
|
|
37
|
-
static ScrArr *scr_ca_system = NULL;
|
|
38
|
-
static ScrArr *scr_ca_extra = NULL;
|
|
39
|
-
static ScrArr *scr_ca_default = NULL;
|
|
40
|
-
static char *scr_ca_extra_buf = NULL;
|
|
41
|
-
static size_t scr_ca_extra_len = 0;
|
|
42
|
-
static bool scr_ca_installed = false;
|
|
43
|
-
static char *scr_ca_override_buf = NULL;
|
|
44
|
-
static size_t scr_ca_override_len = 0;
|
|
45
|
-
static uint64_t scr_ca_override_gen = 0; /* 0 = never set */
|
|
36
|
+
static SCR_TL ScrArr *scr_ca_bundled = NULL;
|
|
37
|
+
static SCR_TL ScrArr *scr_ca_system = NULL;
|
|
38
|
+
static SCR_TL ScrArr *scr_ca_extra = NULL;
|
|
39
|
+
static SCR_TL ScrArr *scr_ca_default = NULL;
|
|
40
|
+
static SCR_TL char *scr_ca_extra_buf = NULL;
|
|
41
|
+
static SCR_TL size_t scr_ca_extra_len = 0;
|
|
42
|
+
static SCR_TL bool scr_ca_installed = false;
|
|
43
|
+
static SCR_TL char *scr_ca_override_buf = NULL;
|
|
44
|
+
static SCR_TL size_t scr_ca_override_len = 0;
|
|
45
|
+
static SCR_TL uint64_t scr_ca_override_gen = 0; /* 0 = never set */
|
|
46
|
+
|
|
47
|
+
#ifdef SCR_WORKERS
|
|
48
|
+
/* Published during executable startup, before any worker exists. The main
|
|
49
|
+
* context owns these raw bytes until all its children have been joined. */
|
|
50
|
+
static const char *scr_ca_initial_extra;
|
|
51
|
+
static size_t scr_ca_initial_extra_len;
|
|
52
|
+
#endif
|
|
46
53
|
|
|
47
54
|
static void scr_ca_oom(void) {
|
|
48
55
|
fputs("scriptc: out of memory\n", stderr);
|
|
@@ -62,12 +69,12 @@ static void scr_ca_teardown(void) {
|
|
|
62
69
|
scr_ca_override_buf = NULL;
|
|
63
70
|
}
|
|
64
71
|
|
|
65
|
-
static bool scr_ca_teardown_armed = false;
|
|
72
|
+
static SCR_TL bool scr_ca_teardown_armed = false;
|
|
66
73
|
|
|
67
74
|
static void scr_ca_arm_teardown(void) {
|
|
68
75
|
if (!scr_ca_teardown_armed) {
|
|
69
76
|
scr_ca_teardown_armed = true;
|
|
70
|
-
|
|
77
|
+
scr_atexit(scr_ca_teardown);
|
|
71
78
|
}
|
|
72
79
|
}
|
|
73
80
|
|
|
@@ -145,10 +152,25 @@ void scr_tls_ca_install(void) {
|
|
|
145
152
|
if (scr_ca_installed) return;
|
|
146
153
|
scr_ca_installed = true;
|
|
147
154
|
scr_ca_arm_teardown();
|
|
155
|
+
#ifdef SCR_WORKERS
|
|
156
|
+
if (!scr_context_is_main()) {
|
|
157
|
+
if (scr_ca_initial_extra) {
|
|
158
|
+
scr_ca_extra_len = scr_ca_initial_extra_len;
|
|
159
|
+
scr_ca_extra_buf = malloc(scr_ca_extra_len + 1);
|
|
160
|
+
if (!scr_ca_extra_buf) scr_ca_oom();
|
|
161
|
+
memcpy(scr_ca_extra_buf, scr_ca_initial_extra, scr_ca_extra_len + 1);
|
|
162
|
+
}
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
#endif
|
|
148
166
|
const char *path = getenv("NODE_EXTRA_CA_CERTS");
|
|
149
167
|
if (path != NULL && path[0] != '\0') {
|
|
150
168
|
scr_ca_extra_buf = scr_ca_read_file(path, &scr_ca_extra_len);
|
|
151
169
|
}
|
|
170
|
+
#ifdef SCR_WORKERS
|
|
171
|
+
scr_ca_initial_extra = scr_ca_extra_buf;
|
|
172
|
+
scr_ca_initial_extra_len = scr_ca_extra_len;
|
|
173
|
+
#endif
|
|
152
174
|
}
|
|
153
175
|
|
|
154
176
|
bool scr_tls_ca_extra_pem(const char **pem, size_t *len) {
|
|
@@ -67,15 +67,20 @@ ScrUnion *scr_union_new_ref(uint32_t tag, void *v, void *(*retain)(void *),
|
|
|
67
67
|
return u;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
static void scr_union_destroy(void *object) {
|
|
71
|
+
ScrUnion *u = object;
|
|
72
|
+
if (u->arm_release) u->arm_release(scr_union_peek(u));
|
|
73
|
+
#ifdef SCR_RC_AUDIT
|
|
74
|
+
scr_live_unions--;
|
|
75
|
+
#endif
|
|
76
|
+
scr_cyc_free(u);
|
|
77
|
+
}
|
|
78
|
+
|
|
70
79
|
void scr_union_release(ScrUnion *u) {
|
|
71
80
|
if (!u || u->rc == SIZE_MAX) return; /* NULL: an uninitialized `let` local */
|
|
72
81
|
if (--u->rc == 0) {
|
|
73
82
|
scr_cyc_on_dead(u);
|
|
74
|
-
|
|
75
|
-
#ifdef SCR_RC_AUDIT
|
|
76
|
-
scr_live_unions--;
|
|
77
|
-
#endif
|
|
78
|
-
scr_cyc_free(u);
|
|
83
|
+
scr_rc_destroy(u, scr_union_destroy);
|
|
79
84
|
} else {
|
|
80
85
|
scr_cyc_on_release(u); /* possible cycle root; may collect — u is done */
|
|
81
86
|
}
|
|
@@ -184,6 +184,7 @@ static bool util_deep_equal(const ScrDyn *a, const ScrDyn *b, bool skip,
|
|
|
184
184
|
if (a->kind == SCR_DYN_BYTES) {
|
|
185
185
|
const ScrBytes *x = a->v.bytes, *y = b->v.bytes;
|
|
186
186
|
if (x->elem != y->elem || x->len != y->len) return false;
|
|
187
|
+
SCR_SHARED_GUARD(x, y);
|
|
187
188
|
size_t length = x->len * scr_bytes_elem_size(x->elem);
|
|
188
189
|
if (length && memcmp(x->data, y->data, length)) return false;
|
|
189
190
|
}
|