rt_finalize WTFs?

bearophile bearophileHUGS at lycos.com
Sun Dec 4 19:43:55 PST 2011


dsimcha:

> I've stumbled on the fact that rt_finalize is 
> taking up a ridiculous share of the time (~30% of total runtime) on a 
> benchmark where huge numbers of classes **that don't have destructors** 
> are being created and collected.

DMD or LDC/GDC compiler?


> extern (C) void rt_finalize(void* p, bool det = true)
> {
>      debug(PRINTF) printf("rt_finalize(p = %p)\n", p);
> 
>      if (p) // not necessary if called from gc
>      {

That if(p) seems fit to become a static if on bool template argument (but it needs to become D code or two C functions):

void rt_finalize(bool byGC)(void* p, bool det = true) { ...

Bye,
bearophile


More information about the Digitalmars-d mailing list