Re: Are g_try_malloc() and g_free() thread-safe?

>g_mem_set_vtable() doesn't really help (at least right now) because I
>can't get any definitive information on whether malloc() and free() are
>thread-safe.  I am building with -D_REENTRANT so the thread-safe

can i make a suggestion to you. try running find(1) on all your header
files and feed the results through grep looking for REENTRANT.

on my system (fedora core 1), there are *zero* occurences of this.

AFAIK, the thread-safe versions of malloc/free are part of the
pthreads library that is linked to your code. the _REENTRANT macro is
a stub thing that lives on in case one day there does need to be
something in the header files, but actually does nothing on any
(most?) current linux systems.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]