halve memory consumption of mempool flist, since we know we cannot have more than n_blocks entries in it

This commit is contained in:
Lennart Poettering 2008-06-27 20:13:26 +02:00
parent c26be0d762
commit 113c62bf5d

View file

@ -693,7 +693,7 @@ pa_mempool* pa_mempool_new(pa_bool_t shared) {
PA_LLIST_HEAD_INIT(pa_memimport, p->imports); PA_LLIST_HEAD_INIT(pa_memimport, p->imports);
PA_LLIST_HEAD_INIT(pa_memexport, p->exports); PA_LLIST_HEAD_INIT(pa_memexport, p->exports);
p->free_slots = pa_flist_new(p->n_blocks*2); p->free_slots = pa_flist_new(p->n_blocks);
return p; return p;
} }
@ -747,7 +747,7 @@ void pa_mempool_vacuum(pa_mempool *p) {
pa_assert(p); pa_assert(p);
list = pa_flist_new(p->n_blocks*2); list = pa_flist_new(p->n_blocks);
while ((slot = pa_flist_pop(p->free_slots))) while ((slot = pa_flist_pop(p->free_slots)))
while (pa_flist_push(list, slot) < 0) while (pa_flist_push(list, slot) < 0)