From c73a298f8887e5c96bc53dc1b2aad2fdbb674f64 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 1 Sep 2004 22:46:27 +0000 Subject: add total sample cache size to statistics add size to sample cache entry info git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@175 fefdeb5f-60dc-0310-8127-8f9354f1896f --- polyp/scache.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'polyp/scache.c') diff --git a/polyp/scache.c b/polyp/scache.c index 311d68a4..b7a8ff02 100644 --- a/polyp/scache.c +++ b/polyp/scache.c @@ -168,3 +168,18 @@ uint32_t pa_scache_get_id_by_name(struct pa_core *c, const char *name) { return e->index; } + +uint32_t pa_scache_total_size(struct pa_core *c) { + struct pa_scache_entry *e; + uint32_t index; + uint32_t sum; + + if (!c->scache) + return 0; + + for (e = pa_idxset_first(c->scache, &index); e; e = pa_idxset_next(c->scache, &index)) + sum += e->memchunk.length; + + + return sum; +} -- cgit