Skip to content
Snippets Groups Projects
Commit 91de8bac authored by Marek Vavruša's avatar Marek Vavruša
Browse files

daemon/worker: less frequent decommit

parent 7e8c9a8f
Branches
Tags
No related merge requests found
......@@ -142,8 +142,8 @@ static void qr_task_free(uv_handle_t *handle)
mp_delete(mp_context);
#if defined(__GLIBC__) && defined(_GNU_SOURCE)
/* Decommit memory every once in a while */
static int mp_delete_count = 0;
if (++mp_delete_count == 2 * worker->pools.cap) {
static size_t mp_delete_count = 0;
if (++mp_delete_count == 100 * MP_FREELIST_SIZE) {
malloc_trim(0);
mp_delete_count = 0;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment