pure static

bearophile bearophileHUGS at lycos.com
Mon Jan 6 16:54:09 PST 2014


Meta:

> Why not just return arr.dup instead? You're returning a slice 
> of a stack-allocated array, so of course you shouldn't write 
> code like this.

In certain critical code paths heap allocations are evil (perhaps 
even if your generational GC has a stack-like nursery, that 
currently the D GC doesn't have) :-) And you also want to 
minimize copies and initializations.

Bye,
bearophile


More information about the Digitalmars-d mailing list