From bf62170fc03883426b156e917f606eee356c056e Mon Sep 17 00:00:00 2001 From: Vladimir Davydov <vdavydov@tarantool.org> Date: Tue, 19 Sep 2023 18:15:29 +0300 Subject: [PATCH] vinyl: purge cache at exit for ASAN Required to suppress the ASAN leak detector. Closes #9158 NO_DOC=ASAN NO_TEST=ASAN NO_CHANGELOG=ASAN --- src/box/vy_cache.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/box/vy_cache.c b/src/box/vy_cache.c index 85d2e324e3..0604d6ab96 100644 --- a/src/box/vy_cache.c +++ b/src/box/vy_cache.c @@ -62,9 +62,18 @@ vy_cache_env_create(struct vy_cache_env *e, struct slab_cache *slab_cache) sizeof(struct vy_cache_node)); } +/** Delete a node from the cache. */ +static void +vy_cache_gc_step(struct vy_cache_env *env); + void vy_cache_env_destroy(struct vy_cache_env *e) { +#if ENABLE_ASAN + /* Purge cache to suppress leak detector. */ + while (e->mem_used > 0) + vy_cache_gc_step(e); +#endif mempool_destroy(&e->cache_node_mempool); } -- GitLab