summaryrefslogtreecommitdiffstats
path: root/polyp/scache.c
diff options
context:
space:
mode:
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;
+}