Tags: cx-home/v
Tags
cx patched V pin — CX-free fork tip (eviction complete)
fix(libgc): P0 vlang#14 — flip bundled amalgamation thread-local-allo… …c to ON The bundled gc.c amalgamation embedded `/* #undef THREAD_LOCAL_ALLOC */` in its autoheader config — the one alloc-lock mitigation left OFF. Flip it to `#define THREAD_LOCAL_ALLOC 1` (the canonical configure-equivalent of `--enable-thread-local-alloc=yes`); the TLA implementation is already present in the amalgamation (guarded by `#ifdef THREAD_LOCAL_ALLOC`), so this activates real code. Compiles clean. This affects the Linux / `-prod`-bundled `gc.o` path only. The macOS `cx` build links the prebuilt `thirdparty/tcc/lib/libgc.a` (built by thirdparty-macos-arm64_bdwgc.sh), which already defaults TLA on — so the flip brings the bundled config into parity with what macOS already ships. Companion runtime lever (already present at this pin): the macOS marker-pin `GC_set_markers_count(1)` before `GC_INIT()` in cmain.v::gen_boehm_gc_init(). Together: ~2.4-5x on MARK-bound multi-thread work. Neither removes the GC_allocate_ml alloc-lock, so alloc-heavy `[?map [par]]` (cx-private vlang#14) stays ~1.3x slower than serial — partial relief by design. Full acceptance + measurements in cx-private bench/parallel-alloc/P0-ACCEPTANCE.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
builtin: skip precompiled libgc gc.o on macOS even under -prod The precompiled `thirdparty/libgc/gc.o` was built with parallel-mark trampolines enabled, which require rwx pages via mprotect(PROT_EXEC). macOS hardened runtime denies rwx pages by default, so any V `-shared` + `-prod` build on macOS aborts at first allocation with "Cannot allocate executable pages". The fix is to skip the precompiled fast-path on macOS and force the source-compile path (via `thirdparty/tcc/lib/libgc.a` archive), which produces a libgc without the trampoline allocator. Linux is unaffected and keeps the precompiled fast-path for `-prod` builds. Companion to the vlang#27178 cgen patch in this fork. With both patches applied, `v -prod -shared` produces a libcx.dylib that dlopen's cleanly under macOS hardened runtime AND auto-registers GC threads for host runtimes that need it.
PreviousNext