What's the go with the GC these days?

welkam wwwelkam at gmail.com
Mon Jan 7 14:25:51 UTC 2019


On Sunday, 6 January 2019 at 08:52:53 UTC, Walter Bright wrote:
> On 1/5/2019 11:58 PM, Manu wrote:
>> If we can help the GC in common code, but still have the 
>> expressive
>> power we need to elide that extra work where we know it's not
>> necessary, then it might be reasonable to consider.
>
> If we could do that, we wouldn't need GC, the compiler could 
> figure out the last use of each pointer. With all the research 
> into GCs, nobody has ever figured that out.

Dont think of it as all or nothing. With dip1000 compiler knows 
the life time of some objects and if they have a reference that 
outlives objects scope. With this information compiler can 
replace some GC allocations with stack or specialized malloc 
allocations with deallocation at the end of the scope. This 
simple addition to compiler could increase performance of GC code 
by a lot in poorly written code.

With some mentoring I could even implement it myself. It doesnt 
sound that hard (famous last words) since lifetime tracking is 
already implemented


More information about the Digitalmars-d mailing list