Getting rid of global objects in kdevplatform/language

Milian Wolff mail at milianw.de
Fri May 14 13:12:52 UTC 2010


David Nolden, 14.05.2010:
> The problem is that like that, actually the creation of the
> repositories is _even less_ well-defined. Before, it was always
> created on shared-library loading, and now it will be created on
> first-use, which may be whenever. For example, if some component uses
> an IndexedString before you manually initialize the repository, it
> will be initialized automatically and wrongly at some random point in
> time.

I don't see how that is more random nor why it's worse in any way ;-) What is 
wrong with init-on-first-use? You didn't need it before after all ;-)

> About moving the .kdevduchain directory into the session directory: I
> actually am not sure if this is a useful thing to do. We often need to
> tell users to delete it, or for example to soft-link it to a temporary
> local directory when used on a NFS share (for performance reasons), so
> this may cause pain without a benefit.

True.

> Btw. your call to duchainify has wrong syntax ("--f"), so it probably
> didn't build the features you requested. With those features, the
> parsing should generally be _much_ slower than the times you reported.

I doubt the "much". If the impact is so small in the default flag (which is 
btw. also the default for KDevelop), it won't blowup by magnitudes in the 
full-blown case.

> Generally I'm ok with doing this, but I think it's not the best
> possible solution to the problem. I'm not sure though what the best
> solution would be. We need a well-defined point in time to initialize
> the duchain repositories, which should be very early, but after we've
> set the session. We at least need to make sure that any use of the
> repositories before they have been initialized by us results in an
> assertion.

We could still "hack" this by calling the getters to force an initialization 
in some point in the app...

But again, I'd like to know what the problems are with the "on-first-use" case.
-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20100514/5f93c463/attachment.sig>


More information about the KDevelop-devel mailing list