diff options
author | Qi Wang <interwq@gwu.edu> | 2017-03-30 00:00:52 (GMT) |
---|---|---|
committer | Qi Wang <interwq@gmail.com> | 2017-04-04 07:34:49 (GMT) |
commit | d3cda3423cd7ae47630833e4a888bdaf6a7bf8d9 (patch) | |
tree | 2d2d1200ae1c7a84201fed491bb9477d5c46339a /src/tsd.c | |
parent | 51d368295032910577d4f34b9ff99b3ed41544b9 (diff) | |
download | jemalloc-d3cda3423cd7ae47630833e4a888bdaf6a7bf8d9.zip jemalloc-d3cda3423cd7ae47630833e4a888bdaf6a7bf8d9.tar.gz jemalloc-d3cda3423cd7ae47630833e4a888bdaf6a7bf8d9.tar.bz2 |
Do proper cleanup for tsd_state_reincarnated.
Also enable arena_bind under non-nominal state, as the cleanup will be handled
correctly now.
Diffstat (limited to 'src/tsd.c')
-rw-r--r-- | src/tsd.c | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -86,6 +86,12 @@ tsd_cleanup(void *arg) { /* Do nothing. */ break; case tsd_state_nominal: + case tsd_state_reincarnated: + /* + * Reincarnated means another destructor deallocated memory + * after this destructor was called. Reset state to + * tsd_state_purgatory and request another callback. + */ #define MALLOC_TSD_cleanup_yes(n, t) \ n##_cleanup(tsd); #define MALLOC_TSD_cleanup_no(n, t) @@ -106,15 +112,6 @@ MALLOC_TSD * nothing, and do not request another callback. */ break; - case tsd_state_reincarnated: - /* - * Another destructor deallocated memory after this destructor - * was called. Reset state to tsd_state_purgatory and request - * another callback. - */ - tsd->state = tsd_state_purgatory; - tsd_set(tsd); - break; default: not_reached(); } |