@gc attribute for bypassign @nogc

bitwise via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 28 09:45:05 PDT 2016


On Thursday, 28 July 2016 at 16:15:04 UTC, Guillaume Piolat wrote:
> On Thursday, 28 July 2016 at 15:24:10 UTC, bitwise wrote:
>>
>> It's not about running out of memory. It's a performance issue.
>>
>> Example: In the following class, it would be perfectly fine, 
>> and even expected to allocate in start() but not in update(). 
>> This is because start() gets called once on object 
>> initialization, but update() would get called every frame.
>>
>
> Vladimir implemented counting in -profile=gc, it gives you the 
> number of allocations and the amount allocated for each 
> allocation point.

I'm not sure if this point is meant to be for or against what I'm 
suggesting, but still, I'm thinking in terms of *proactively* 
writing efficient code, not allowing an app get to the point 
where you need to run a profiler.

The situation is similar to using @safe. You *could* just write 
code however you want, wait until it crashes, then try to find 
the problem using Valgrind or something, but that's bad for 
obvious reasons.

     Bit



More information about the Digitalmars-d mailing list