mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-22 20:53:07 +00:00
Pull tcache GC events into thread event handler
This commit is contained in:
@@ -2350,10 +2350,6 @@ je_malloc(size_t size) {
|
||||
|
||||
tcache_t *tcache = tsd_tcachep_get(tsd);
|
||||
|
||||
if (unlikely(ticker_trytick(&tcache->gc_ticker))) {
|
||||
return malloc_default(size);
|
||||
}
|
||||
|
||||
szind_t ind = sz_size2index_lookup(size);
|
||||
/*
|
||||
* The thread_allocated counter in tsd serves as a general purpose
|
||||
|
||||
@@ -18,6 +18,17 @@ static void thread_##event##_event_handler(tsd_t *tsd);
|
||||
ITERATE_OVER_ALL_EVENTS
|
||||
#undef E
|
||||
|
||||
static void
|
||||
thread_tcache_gc_event_handler(tsd_t *tsd) {
|
||||
assert(TCACHE_GC_INCR_BYTES > 0);
|
||||
assert(tcache_gc_event_wait_get(tsd) == 0U);
|
||||
thread_tcache_gc_event_update(tsd, TCACHE_GC_INCR_BYTES);
|
||||
tcache_t *tcache = tcache_get(tsd);
|
||||
if (tcache != NULL) {
|
||||
tcache_event_hard(tsd, tcache);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
thread_prof_sample_event_handler(tsd_t *tsd) {
|
||||
assert(config_prof && opt_prof);
|
||||
|
||||
Reference in New Issue
Block a user