https://issues.dlang.org/show_bug.cgi?id=11817

Adam D. Ruppe <destructiona...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |destructiona...@gmail.com

--- Comment #3 from Adam D. Ruppe <destructiona...@gmail.com> ---
There's also struct and field padding, which is defined as being filled with
zeroes, so an initializer may have zeroes around it even if there's void.

But, if everything at the end, including padding, is void-initialized, the
.init could be truncated. If any code uses .init.length instead of .sizeof,
such code would be broken, but I think that code is broken already.

So the easy fix would be a truncated initializer - no holes in the middle (at
least not at this point), but a big hole in the end... just you have to make
sure there's no padding involved - the performance benefit would come only when
you properly align things and set that to void too, which isn't hard to do.

=void in the middle btw could just be zeroes in the initializer for now since
it is undefined anyway.

--

Reply via email to