Skip to content
Snippets Groups Projects
Commit 5ff29e4f authored by Konstantin Shulgin's avatar Konstantin Shulgin
Browse files

Test suite:

Valgrind tests was fixed.
parent ece3f504
No related branches found
No related tags found
No related merge requests found
......@@ -1428,6 +1428,7 @@ void
mod_free(void)
{
space_free();
memcached_free();
}
void
......
......@@ -33,6 +33,9 @@ struct tarantool_cfg;
void
memcached_init();
void
memcached_free();
void
memcached_space_init();
......
......@@ -47,6 +47,7 @@ static int stat_base;
static struct fiber *memcached_expire = NULL;
static Index *memcached_index;
static struct iterator *memcached_it;
/* memcached tuple format:
<key, meta, data> */
......@@ -418,6 +419,13 @@ memcached_init(void)
memcached_index = space[cfg.memcached_space].index[0];
}
void
memcached_free()
{
if (memcached_it)
memcached_it->free(memcached_it);
}
void
memcached_space_init()
{
......@@ -488,17 +496,17 @@ memcached_expire_loop(void *data __attribute__((unused)))
struct box_tuple *tuple = NULL;
say_info("memcached expire fiber started");
struct iterator *it = [memcached_index allocIterator];
memcached_it = [memcached_index allocIterator];
@try {
restart:
if (tuple == NULL)
[memcached_index initIterator: it];
[memcached_index initIterator: memcached_it];
struct tbuf *keys_to_delete = tbuf_alloc(fiber->gc_pool);
for (int j = 0; j < cfg.memcached_expire_per_loop; j++) {
tuple = it->next(it);
tuple = memcached_it->next(memcached_it);
if (tuple == NULL)
break;
......@@ -513,7 +521,8 @@ restart:
fiber_gc();
goto restart;
} @finally {
it->free(it);
memcached_it->free(memcached_it);
memcached_it = NULL;
}
}
......@@ -523,7 +532,7 @@ void memcached_start_expire()
return;
assert(memcached_expire == NULL);
memcached_expire = fiber_create("memecached_expire", -1,
memcached_expire = fiber_create("memcached_expire", -1,
-1, memcached_expire_loop, NULL);
if (memcached_expire == NULL)
say_error("can't start the expire fiber");
......
......@@ -139,6 +139,17 @@
...
}
{
<box upadte command>
Memcheck:Leak
fun:salloc
fun:tuple_alloc
fun:prepare_update
fun:box_dispatch
fun:box_process*
...
}
##
## tarantool/lua suppressions
##
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment