blaise/runtime
Andrew Haines 4e61cb1e8f fix(rtl): run one-time RTL setup via a _BlaiseInit startup hook
A unit's initialization section only runs when that unit is compiled
into the program's own translation unit; units linked from a prebuilt
archive never get their _init called.  blaise_weak relies on its
initialization section to set up the weak-reference table mutex, so for
archive builds that setup never happened.  A zero-filled mutex object is
a valid unlocked mutex on some platforms, which kept this latent — but
that is not guaranteed everywhere.

Add a _BlaiseInit RTL entry point that performs the one-time setup
(currently the weak-table mutex, guarded to stay idempotent) and have
each backend's $main emit a call to it right after _SetArgs, before any
user code runs.  The mutex is now initialised explicitly instead of by
relying on a zero-filled object happening to be valid.

Regression: cp.test.codegen TestMain_CallsBlaiseInit asserts the call.
2026-06-17 00:10:53 +01:00
..
src fix(rtl): run one-time RTL setup via a _BlaiseInit startup hook 2026-06-17 00:10:53 +01:00
Makefile feat(sets): jumbo sets — set of enum up to 256 members 2026-06-14 23:23:19 +01:00
project.xml refactor: split rtl/ into runtime/ + stdlib/, rename bcl.testing to blaise.testing 2026-05-16 00:51:18 +01:00