Le 31/07/2016 à 19:52, Richard Heck a écrit :
+++ b/src/frontends/qt4/GuiCitation.cpp

Is there some way we could store these per BufferView or something? I'd
kind of
like to save the last searched string for each document, rather than
globally.

Yes, I think there must be a better solution.

+++ b/src/frontends/qt4/GuiDocument.cpp

I think this cache could just be removed. It's used when we validate
listings parameters,
which is (a) very rarely and (b) a GUI-related operation, which means
that the very minor
speed optimization involved will not be noticed.

Agreed.

+++ b/src/frontends/qt4/GuiFontLoader.cpp
+       thread_local vector<int> cache_set(NUM_FAMILIES, false);

Here, I think we'd prefer to have something actually global (although,
as I said, this
change will not now have any practical effect). Can the "atomic" stuff
be used to allow
us to do that?

It is not possible to have an atomic vector/array because atomics only
work for trivially copyable types. Then, I started reading about
vector/arrays of atomics in c++ and this started giving me a headache.
So I am going to reply that having a thread_local cache is the simplest
solution.


PS We have:
    static vector<int> cache_set(NUM_FAMILIES, false);
    cache_set[family] = true;
??

vector<bool> has a specific implementation, so maybe it used to cause issues on some compliers for some reason. It works fine here.


Reply via email to