mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-23 21:23:06 +00:00
Push event handlers to constituent modules
This commit is contained in:
22
src/tcache.c
22
src/tcache.c
@@ -60,8 +60,14 @@ tcache_gc_dalloc_postponed_event_wait(tsd_t *tsd) {
|
||||
return TE_MIN_START_WAIT;
|
||||
}
|
||||
|
||||
void
|
||||
tcache_event_hard(tsd_t *tsd, tcache_slow_t *tcache_slow, tcache_t *tcache) {
|
||||
static void
|
||||
tcache_event(tsd_t *tsd) {
|
||||
tcache_t *tcache = tcache_get(tsd);
|
||||
if (tcache == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
tcache_slow_t *tcache_slow = tsd_tcache_slowp_get(tsd);
|
||||
szind_t binind = tcache_slow->next_gc_bin;
|
||||
bool is_small = (binind < SC_NBINS);
|
||||
cache_bin_t *cache_bin = &tcache->bins[binind];
|
||||
@@ -110,6 +116,18 @@ tcache_event_hard(tsd_t *tsd, tcache_slow_t *tcache_slow, tcache_t *tcache) {
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
tcache_gc_event_handler(tsd_t *tsd, uint64_t elapsed) {
|
||||
assert(elapsed == TE_INVALID_ELAPSED);
|
||||
tcache_event(tsd);
|
||||
}
|
||||
|
||||
void
|
||||
tcache_gc_dalloc_event_handler(tsd_t *tsd, uint64_t elapsed) {
|
||||
assert(elapsed == TE_INVALID_ELAPSED);
|
||||
tcache_event(tsd);
|
||||
}
|
||||
|
||||
void *
|
||||
tcache_alloc_small_hard(tsdn_t *tsdn, arena_t *arena,
|
||||
tcache_t *tcache, cache_bin_t *cache_bin, szind_t binind,
|
||||
|
||||
Reference in New Issue
Block a user