[Pixman] Valgrind-clean pixman
siarhei.siamashka at gmail.com
Sun Aug 29 02:19:36 PDT 2010
On Saturday 28 August 2010 12:21:52 Andrea Canciani wrote:
> On Fri, Aug 27, 2010 at 3:58 PM, Siarhei Siamashka
> > Having something like pixman_init()/pixman_cleanup() functions could
> > solve all the problems, but it's an API change. Other solutions (using
> > atexit(), using mutexes or atomic oparations when initializing
> > implementation, putting 'global_implementation' into thread local
> > storage, etc.) seem to all have some risk of introducing portability
> > issues and/or add extra runtime overhead.
> Would using library ctor/dtor be ok? They should be available both on win32
> (DllMain) and as a gcc attribute and would allow to initialize things in a
> very simple way (without having to use any synchronization).
> We probably want to implement DllMain on win32 to allocate/free TLS anyway.
Yes, I think it makes sense to give this a try. The constructor attribute is
supported since at least gcc 2.95, and it seems to be fine in clang 2.7 too.
There's always a risk that this stuff may be broken for some gcc versions or
target systems, but we can never know before trying :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: This is a digitally signed message part.
More information about the Pixman