On Fri, 03 Feb 2012 20:11:18 +0100, Steve Schveighoffer
<[email protected]> wrote:
________________________________
From: Daniel Murphy <[email protected]>
On Sat, Feb 4, 2012 at 2:31 AM, Steve Schveighoffer
<[email protected]> wrote:
2. This conversion: [a:b, c:d] --> AALiteral([a, c], [b, d]) should
*NOT* use the heap for the two array literals. I'm not sure how you
can declare AALiteral such that this doesn't happen, but this needs to
be solved.
It's not about how AALiteral is declared, it's how the compiler calls
it. For a lot of druntime calls it currently does something along the
lines of:
Key[dim] keys;
... store the keys ...
Value[dim] values;
... store the values ...
aa = AAliteral(key, value);
We'll need to define an interface, but that's just the point - the
current half-language/half-runtime solution doesn't have this.
Right, the point I was bringing is that if the new method is to do a
simple lowering using the above translation, today that means heap
allocations. If that means we need to invent some new syntax, I'm all
for it, or if it means the compiler needs to do a translation more like
what you said than a simple expression change, then so be it.
I just don't want to move from the current method to something that
unnecessarily heap-allocates, we already have enough of that.
-Steve
What is allocating?
Are you referring to this
http://d.puremagic.com/issues/show_bug.cgi?id=2356?
_______________________________________________
dmd-internals mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/dmd-internals