On Phobos GC hunt

Dmitry Olshansky via Digitalmars-d digitalmars-d at puremagic.com
Tue Oct 7 08:57:58 PDT 2014


I made a proposal to quantatively measure and tabulate all GC 
allocations in Phobos before coming up with solutions to "@nogc 
Phobos".

After approving node from Andrei I've come up with a piece of 
automation to extract this data and post it on wiki.

So here is the exhustive list of everything calling into GC in 
Phobos (-vgc compiler flag):

http://wiki.dlang.org/Stuff_in_Phobos_That_Generates_Garbage

Including source links, a wild guess at function's name and the 
compiler's warning message for potential GC call.

As far as data goes this is about as good as we can get, the next 
phase is labeling this stuff with potential solution(s). Again 
doing all by hand is tedious and hardly useful.

Instead we need to observe patterns and label it automatically 
until the non-trivial subset remains. So everybody, please take 
time and identify simple patterns and post back your ideas on 
solution(s).

So far I see the most frequent cases:
- `new SomeException` - switch to RC exceptions
- AA access - ??? (use user-defined AA type as parameter?)
- array concat - ???
- closure - ???



---
Dmitry Olshansky


More information about the Digitalmars-d mailing list