From 7ff1ce4131651fea1df7b1c010d71667bc574816 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Wed, 18 Apr 2012 18:29:47 +0200 Subject: [PATCH] Initialize all members of non-TLS tsd wrapper when creating it Not setting the initialized member leads to randomly calling the cleanup function in cases it shouldn't be called (and isn't called in other implementations). --- include/jemalloc/internal/tsd.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/jemalloc/internal/tsd.h b/include/jemalloc/internal/tsd.h index 35ae5e3c..3f953f9a 100644 --- a/include/jemalloc/internal/tsd.h +++ b/include/jemalloc/internal/tsd.h @@ -253,6 +253,7 @@ a_name##_tsd_get_wrapper(void) \ } else { \ static a_type tsd_static_data = a_initializer; \ wrapper->isstatic = false; \ + wrapper->initialized = false; \ wrapper->val = tsd_static_data; \ } \ if (pthread_setspecific(a_name##_tsd, \