Steven Schveighoffer:

> Interesting trivia, the compiler actually transforms the following:
> 
> struct S
> {
>   int x;
> }
> 
> auto s = new S;
> 
> into this:
> 
> auto s = (new S[1]).ptr;
> 
> Found that out when revamping the array allocation code.  It's one thing  
> that still bugs me because this means s will be initialized as an  
> appendable array when it doesn't have to be.

What are the disadvantages caused by this?
If the disadvantages are significant is this improvement in Bugzilla as 
enhancement request?
Struct heap allocations are important, they are a basic part of D programming.

Bye,
bearophile

Reply via email to