A benchmark, mostly GC

Timon Gehr timon.gehr at gmx.ch
Mon Dec 12 02:45:04 PST 2011


On 12/12/2011 03:56 AM, dsimcha wrote:
> On 12/11/2011 9:41 PM, Timon Gehr wrote:
>> On 12/11/2011 11:37 PM, dsimcha wrote:
>>> On 12/11/2011 4:26 PM, Timon Gehr wrote:
>>>> We are talking about supporting precise GC, not about custom runtime
>>>> reflection. There is no way to get precise GC right without compiler
>>>> support.
>>>
>>> FWIW my original precise heap scanning patch generated pointer offset
>>> information using CTFE and templates. The code to do this is still in
>>> Bugzilla and only took a couple hours to write.
>>
>> But it is not precise for the stack, right? How much work is left to the
>> programmer to generate the information?
>
> It wasn't precise on the stack, but for unrelated reasons. As far as
> work left to the programmer, I has created templates for new (which I
> thought at the time might get integrated into the compiler).

That is compiler support. ;)

> To use the
> precise heap scanning, all you had to do was:
>
> class C {
> void* ptr;
> size_t integer;
> }
>
> void main() {
> auto instance = newTemplate!C();
> }

Ok, nice. I template my allocations anyway. (even though it creates some 
bloat)


More information about the Digitalmars-d mailing list