summaryrefslogtreecommitdiffstats
path: root/polyp/scache.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2004-09-01 22:46:27 +0000
committerLennart Poettering <lennart@poettering.net>2004-09-01 22:46:27 +0000
commitc73a298f8887e5c96bc53dc1b2aad2fdbb674f64 (patch)
treec2308ac47873e778f86e32ed01dd69fff90b8825 /polyp/scache.c
parent5f52999c016495be1c34effdacd230a79cb52d0b (diff)
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
Diffstat (limited to 'polyp/scache.c')
-rw-r--r--polyp/scache.c15
1 files changed, 15 insertions, 0 deletions
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;
+}