[Issue 14571] [REG2.064] Large static arrays seem to lock up DMD

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri May 22 03:39:15 PDT 2015


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

--- Comment #9 from Walter Bright <bugzilla at digitalmars.com> ---
(In reply to Vladimir Panteleev from comment #7)
> The problem is entirely with .init.

Which is a global variable, and has all the downsides of them. My advice still
applies.

> Additionally, dynamic arrays cannot always be used as a drop-in replacement
> for static arrays. They add one level of indirection and cannot easily be
> aligned together with other types (as with static arrays in a struct).

Global arrays already have that extra indirection. I'm also hard pressed to see
how a large struct is going to suffer from an extra indirection to the array,
when it surely is going to suffer much worse from cache invalidation.

> The problem should be avoided if you change the declaration to "double
> position = 0;"

True, then it goes into the BSS segment, but the other issues still apply that
are not fixable by changing the compiler (i.e. executable bloat).

--


More information about the Digitalmars-d-bugs mailing list