diff options
author | Mike Hommey <mh@glandium.org> | 2012-04-18 16:29:47 (GMT) |
---|---|---|
committer | Jason Evans <jasone@canonware.com> | 2012-04-19 02:23:32 (GMT) |
commit | 7ff1ce4131651fea1df7b1c010d71667bc574816 (patch) | |
tree | 4abfcada7043b8e7221489c464d4b5689a269735 | |
parent | 86e58583bb443fcfe885a1a96b466ab5933cb443 (diff) | |
download | jemalloc-7ff1ce4131651fea1df7b1c010d71667bc574816.zip jemalloc-7ff1ce4131651fea1df7b1c010d71667bc574816.tar.gz jemalloc-7ff1ce4131651fea1df7b1c010d71667bc574816.tar.bz2 |
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).
-rw-r--r-- | include/jemalloc/internal/tsd.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/jemalloc/internal/tsd.h b/include/jemalloc/internal/tsd.h index 35ae5e3..3f953f9 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, \ |