On Thu, 24 Feb 2011 16:21:08 -0500, Andrej Mitrovic <andrej.mitrov...@gmail.com> wrote:

Of course it's not that hard. But when things can be safely automated,
I don't see why they shouldn't be. Unless I'm missing some important
factor of duping string literals that was not mentioned already.

It's a 'hidden allocation'. It leads to low performance code that looks like it's really fast.

There are plenty of examples of hidden allocation in D already which I would hope we could get rid of, I wouldn't want to add more.

For example, try using an AA literal as an enum, and then use that enum in lots of places. Guess what? Each time you use it, the runtime constructs a new instance of the AA!

I think we should strive to require explicit requests for allocations as much as possible.

-Steve

Reply via email to