Getting rid of global objects in kdevplatform/language

David Nolden zwabel at googlemail.com
Fri May 14 13:31:21 UTC 2010


2010/5/14 Benjamin Schindler <bschindler at inf.ethz.ch>:

> While I'm still not entirely familiar with the internals, the thing
> about the well-definedness is not really true.
> I'm sure you know the static-initialization fiasco - when you statically
> initialize data, there is no way to tell which is going first. By having
> static variables in functions, it lets you actually initialize A before
> B if B depends on A. With just static variables, that's not possible. So
> the order is actually more defined...

Sure, that was already done anyway. The remaining cases that Andreas
fixed weren't recursively dependent on each other (I think), and their
only effect was that the duchain repositories were initialized
directly when the kdevplatformlanguage library was loaded, thus the
point of initialization was well-defined.

Anyway, of course I guess we can simply enforce the initialization of
the duchain repositories as soon as we've set its parameters correctly
(session etc.). We will just have to make sure that nobody tries to
use the repositories before that happens.




More information about the KDevelop-devel mailing list