aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason Evans <je@fb.com>2016-02-02 20:37:24 -0800
committerJason Evans <jasone@canonware.com>2016-02-19 20:29:06 -0800
commitc87ab25d189e0ae76fd568db4bf273e2788cf1a9 (patch)
tree8433524850dc689fc69c3297183d717f0877882a /src
parent9998000b2b77205a37ae630d5fd1ec9ee4569476 (diff)
downloadjemalloc-c87ab25d189e0ae76fd568db4bf273e2788cf1a9.tar.gz
Use ticker for incremental tcache GC.
Diffstat (limited to 'src')
-rw-r--r--src/tcache.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tcache.c b/src/tcache.c
index 78c6230..e8c3152 100644
--- a/src/tcache.c
+++ b/src/tcache.c
@@ -67,7 +67,6 @@ tcache_event_hard(tsd_t *tsd, tcache_t *tcache)
tcache->next_gc_bin++;
if (tcache->next_gc_bin == nhbins)
tcache->next_gc_bin = 0;
- tcache->ev_cnt = 0;
}
void *
@@ -330,6 +329,8 @@ tcache_create(tsd_t *tsd, arena_t *arena)
tcache_arena_associate(tcache, arena);
+ ticker_init(&tcache->gc_ticker, TCACHE_GC_INCR);
+
assert((TCACHE_NSLOTS_SMALL_MAX & 1U) == 0);
for (i = 0; i < nhbins; i++) {
tcache->tbins[i].lg_fill_div = 1;