dlang-supplemental

News

Thread-local GC proposed upstream

2 August 2026

We opened an opt-in thread-local garbage collector for D—registered as tgc—against upstream DMD/druntime.

GitHub records the pull request as opened : dlang/dmd#23514.

Select it at runtime. The default conservative collector does not change:

./app --DRT-gcopt=gc:tgc
Mock terminal enabling tgc with --DRT-gcopt=gc:tgc
Opt-in only. Conservative stays the default factory.

Each attached thread owns a private heap. A local collection should not call thread_suspendAll, so sibling threads and detached @nogc workers keep running. Cross-thread sharing of mutable GC pointers is out of scope for v1.

Read next: