Steven Schveighoffer <> changed:

           What    |Removed                     |Added
             Status|RESOLVED                    |REOPENED
         Resolution|WONTFIX                     |

--- Comment #2 from Steven Schveighoffer <> 2010-06-25 
13:37:13 PDT ---
No, this can be fixed.  It has nothing to do with the contents of the static
ctors/dtors, the problem is that the cycle detection algorithm is broken (it
fails to detect non-trivial cycles).

The question to answer is if the compiler can generate a transitive dependency

That is, if module a depends on b, and module b depends on c, then module a
depends on c.  Can this be detected at compile time?

If so, then the compiler can generate a full list, and the topographical sort
of the modules can be very easy without allocating extra space.

If not, then we can still solve the problem by first eliminating unneeded
modules from the list.

My guess is that the compiler cannot generate such a list, but if I"m wrong,
then the compiler can improve startup performance by generating the list.

Right now, the runtime incorrectly allows cycles which can result in undefined
behavior when D specifically is supposed to disallow import cycles, regardless
of ctor/dtor contents.  I can fix this, and keep the algorithm complexity the
same, but it's a bit awkward and requires allocating memory.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to