Make tsd cleanup functions optional, remove noop cleanup functions.

This commit is contained in:
Jason Evans
2016-06-02 11:11:35 -07:00
parent e28b43a739
commit 7be2ebc23f
11 changed files with 23 additions and 81 deletions

View File

@@ -644,20 +644,6 @@ arena_choose_hard(tsd_t *tsd, bool internal)
return (ret);
}
void
thread_allocated_cleanup(tsd_t *tsd)
{
/* Do nothing. */
}
void
thread_deallocated_cleanup(tsd_t *tsd)
{
/* Do nothing. */
}
void
iarena_cleanup(tsd_t *tsd)
{
@@ -693,20 +679,6 @@ arenas_tdata_cleanup(tsd_t *tsd)
}
}
void
narenas_tdata_cleanup(tsd_t *tsd)
{
/* Do nothing. */
}
void
arenas_tdata_bypass_cleanup(tsd_t *tsd)
{
/* Do nothing. */
}
static void
stats_print_atexit(void)
{

View File

@@ -285,10 +285,3 @@ rtree_elm_witness_release(tsdn_t *tsdn, const rtree_t *rtree,
witness_unlock(tsdn, witness);
rtree_elm_witness_dalloc(tsdn_tsd(tsdn), witness, elm);
}
void
rtree_elm_witnesses_cleanup(tsd_t *tsd)
{
/* Do nothing. */
}

View File

@@ -404,13 +404,6 @@ tcache_cleanup(tsd_t *tsd)
}
}
void
tcache_enabled_cleanup(tsd_t *tsd)
{
/* Do nothing. */
}
void
tcache_stats_merge(tsdn_t *tsdn, tcache_t *tcache, arena_t *arena)
{

View File

@@ -77,9 +77,14 @@ tsd_cleanup(void *arg)
/* Do nothing. */
break;
case tsd_state_nominal:
#define O(n, t) \
#define MALLOC_TSD_cleanup_yes(n, t) \
n##_cleanup(tsd);
#define MALLOC_TSD_cleanup_no(n, t)
#define O(n, t, c) \
MALLOC_TSD_cleanup_##c(n, t)
MALLOC_TSD
#undef MALLOC_TSD_cleanup_yes
#undef MALLOC_TSD_cleanup_no
#undef O
tsd->state = tsd_state_purgatory;
tsd_set(tsd);

View File

@@ -103,13 +103,6 @@ witnesses_cleanup(tsd_t *tsd)
/* Do nothing. */
}
void
witness_fork_cleanup(tsd_t *tsd)
{
/* Do nothing. */
}
void
witness_prefork(tsd_t *tsd)
{