summaryrefslogtreecommitdiffstats
path: root/include/jemalloc
diff options
context:
space:
mode:
authorJason Evans <je@fb.com>2016-02-03 04:37:24 (GMT)
committerJason Evans <jasone@canonware.com>2016-02-20 04:29:06 (GMT)
commitc87ab25d189e0ae76fd568db4bf273e2788cf1a9 (patch)
tree8433524850dc689fc69c3297183d717f0877882a /include/jemalloc
parent9998000b2b77205a37ae630d5fd1ec9ee4569476 (diff)
downloadjemalloc-c87ab25d189e0ae76fd568db4bf273e2788cf1a9.zip
jemalloc-c87ab25d189e0ae76fd568db4bf273e2788cf1a9.tar.gz
jemalloc-c87ab25d189e0ae76fd568db4bf273e2788cf1a9.tar.bz2
Use ticker for incremental tcache GC.
Diffstat (limited to 'include/jemalloc')
-rw-r--r--include/jemalloc/internal/tcache.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/include/jemalloc/internal/tcache.h b/include/jemalloc/internal/tcache.h
index aa73060..c64f5d3 100644
--- a/include/jemalloc/internal/tcache.h
+++ b/include/jemalloc/internal/tcache.h
@@ -83,7 +83,7 @@ struct tcache_bin_s {
struct tcache_s {
ql_elm(tcache_t) link; /* Used for aggregating stats. */
uint64_t prof_accumbytes;/* Cleared after arena_prof_accum(). */
- unsigned ev_cnt; /* Event count since incremental GC. */
+ ticker_t gc_ticker; /* Drives incremental GC. */
szind_t next_gc_bin; /* Next bin to GC. */
tcache_bin_t tbins[1]; /* Dynamically sized. */
/*
@@ -247,9 +247,7 @@ tcache_event(tsd_t *tsd, tcache_t *tcache)
if (TCACHE_GC_INCR == 0)
return;
- tcache->ev_cnt++;
- assert(tcache->ev_cnt <= TCACHE_GC_INCR);
- if (unlikely(tcache->ev_cnt == TCACHE_GC_INCR))
+ if (unlikely(ticker_tick(&tcache->gc_ticker)))
tcache_event_hard(tsd, tcache);
}