summaryrefslogtreecommitdiffstats
path: root/src/tsd.c
diff options
context:
space:
mode:
authorQi Wang <interwq@gwu.edu>2017-03-30 00:00:52 (GMT)
committerQi Wang <interwq@gmail.com>2017-04-04 07:34:49 (GMT)
commitd3cda3423cd7ae47630833e4a888bdaf6a7bf8d9 (patch)
tree2d2d1200ae1c7a84201fed491bb9477d5c46339a /src/tsd.c
parent51d368295032910577d4f34b9ff99b3ed41544b9 (diff)
downloadjemalloc-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.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/tsd.c b/src/tsd.c
index 970d5ba..6b68c00 100644
--- a/src/tsd.c
+++ b/src/tsd.c
@@ -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();
}