Getting rid of global objects in kdevplatform/language

Andreas Pakulat apaku at gmx.de
Fri May 14 14:09:55 UTC 2010


On 14.05.10 15:31:21, David Nolden wrote:
> 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.

I'll take this mail as sample for this. As the sessioncontroller is
actually the very, very first thing that gets created by core, having it
initialize the duchain repos should be enough. 

The only two ways I can think of that could then access the repository
before its initialized properly are:

a) the main application access IndexedString (or something else that needs
a repository), which is a brain-dead thing in the app's code

b) some other library creates a global static object (or just a global
object) from one of the types that needs a repository. This should
be fixed in the libs.

Can you let me know which function(s) I should call to do the
initialization from session-controller? Then I'll add the necessary assert
in the itemrepository code so we catch the above two cases.

BTW: Changing from standard-mode to the all-declarations-and-uses mode
actually did make a difference, first the parsing time for kdevplatform was
around 50s, with the all-in it was 1m40 as in my original mail. But I'll
double-check tonight.

Andreas

-- 
Tuesday After Lunch is the cosmic time of the week.




More information about the KDevelop-devel mailing list