Thicket thicket
ocaml
REPOS 1

Core covers the OCaml compiler and language RFCs.

W19.2025 · 5–11 Mayocaml/ocaml

Features

OCaml trunk (atomic record fields): Merged 2025-05-07. Record fields can now be marked [@atomic]; reads and writes compile to atomic operations. The [%atomic.loc] syntax and Atomic.Loc submodule expose get, set, exchange, compare_and_set, fetch_and_add, incr, and decr on atomic field locations. No make_contended analogue exists for record fields yet. #13404

Unix.unsetenv: Merged 2025-05-10. Adds Unix.unsetenv : string -> unit to remove a variable from the process environment. Uses _wputenv_s on Windows. #14020

Option.product and Option.Syntax: Merged 2025-05-10. Adds Option.product : 'a option -> 'b option -> ('a * 'b) option and an Option.Syntax submodule with binding operators, mirroring the existing List.Syntax and Seq.Syntax. #13916

Dynarray.unsafe_to_iarray: Merged 2025-05-06. Adds Dynarray.unsafe_to_iarray : capacity:int -> ('a t -> unit) -> 'a Iarray.t, converting a dynarray to an immutable array without copying. Safe in single-domain settings; available in 5.4. #13909

Fixes

Demarshaling memory corruption: Merged 2025-05-06. Marshal.from_string could segfault when a GC was triggered by exception allocation mid-demarshal, because a partially initialized block was registered as a GC root. The fix removes the spurious CAMLlocal1 registration. Backport to 4.14, 5.3, and 5.4 planned. #14015, issue #14007

Domain.spawn deadlock on failure: Merged 2025-05-10. If child-domain initialization failed, the domain lock was not released, causing a permanent deadlock on the next Domain.spawn call. The lock is now released on the failure path. #13953

OCaml 5.4 type_approx regression: Merged 2025-05-11. A labeled-tuples change in 5.4 caused type_approx to drop type constraints inside tuples for mutually recursive functions, producing a misleading error on the tuple element instead of the use site. The fix restores 5.3/trunk behaviour. #14021

Compatibility and Releases

Compaction race condition (proposal): Opened 2025-05-11. Terminating domains orphaned their shared-heap pools after leaving the STW participant set, so the compactor could run while pools were in an untracked state, causing segfaults or assertion failures. The proposal moves the orphaning step before STW exit. Not yet merged. #14025, issue #13739