← board

Thread-safe layout RTTI helper races

Symptom

The target-independent layout RTTI helpers centralize managed record and dynamic array retain/release/COW behavior in builtinheap.pas, but not every generated call path has the same thread-safety guarantees as the old inline x86-64 code.

Known risky paths:

Single-threaded and current regression tests pass, including make test and make test-nilpy, but {$threadsafe on} programs that share managed records or nested dynamic arrays across threads may race refcount updates or free-list operations.

Acceptance

Log