thiago at kde.org
Sun Oct 28 16:22:39 GMT 2012
On domingo, 28 de outubro de 2012 17.12.31, Frank Reininghaus wrote:
> The functions with statics are:
> 1. KStringHandler::isUtf8(const char *)
Do notice that it's static const POD. Since it's not modifying anything, it's
thread-safe. And stateless.
> 2. KStringHandler::from8Bit(const char *)
> The first one contains a static array of chars, which looks safe to
> me. The second has a static reference to a QString which is generated
> using KGlobal::staticQString(const char*). I'm not entirely sure if
> that is safe as well.
That's a static const non-POD created by a non-constexpr. That means it's
initialised on the first run.
It's thread-safe on GCC and C++11, but not on other conditions.
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 190 bytes
Desc: This is a digitally signed message part.
More information about the kde-core-devel