Fix two quarantine regressions.

Fix quarantine to actually update tsd when expanding, and to avoid
double initialization (leaking the first quarantine) due to recursive
initialization.

This resolves #161.
This commit is contained in:
Jason Evans
2014-11-04 18:03:11 -08:00
parent 2b2f6dc1e4
commit c002a5c800
3 changed files with 26 additions and 2 deletions

View File

@@ -339,6 +339,7 @@ prof_thread_name_set
quarantine
quarantine_alloc_hook
quarantine_cleanup
quarantine_alloc_hook_work
quarantine_init
register_zone
rtree_delete

View File

@@ -30,6 +30,7 @@ struct quarantine_s {
#ifdef JEMALLOC_H_EXTERNS
quarantine_t *quarantine_init(tsd_t *tsd, size_t lg_maxobjs);
void quarantine_alloc_hook_work(tsd_t *tsd);
void quarantine(tsd_t *tsd, void *ptr);
void quarantine_cleanup(tsd_t *tsd);
@@ -50,8 +51,8 @@ quarantine_alloc_hook(void)
assert(config_fill && opt_quarantine);
tsd = tsd_fetch();
if (tsd_quarantine_get(tsd) == NULL && tsd_nominal(tsd))
tsd_quarantine_set(tsd, quarantine_init(tsd, LG_MAXOBJS_INIT));
if (tsd_quarantine_get(tsd) == NULL)
quarantine_alloc_hook_work(tsd);
}
#endif