[PATCH] Simplify TSD without TLS

Mike Hommey mh+jemalloc at glandium.org
Tue Apr 17 03:07:15 PDT 2012


On Tue, Apr 17, 2012 at 12:01:04PM +0200, Mike Hommey wrote:
> From: Mike Hommey <mh at glandium.org>
> 
> ---
>  include/jemalloc/internal/tsd.h |   85 +++++++++------------------------------
>  1 file changed, 20 insertions(+), 65 deletions(-)

Just a few notes: this implementation is 95% the same as the one I have
for mingw. I'm even tempted to make them actually share the code,
because it would make changes/fixes to one be used in the other.

It doesn't use a static variable when malloc_tsd_malloc
fails, but unconditionally aborts instead. Using a static variable is
due to fail with multithreading anyways. The 'initialized' variable is
not necessary either, as pthread_key's cleanup function won't be called
unless a non-NULL value has been set with pthread_setspecific.

Mike



More information about the jemalloc-discuss mailing list