summaryrefslogtreecommitdiffstats
path: root/src/memblock.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2004-07-15 20:12:21 +0000
committerLennart Poettering <lennart@poettering.net>2004-07-15 20:12:21 +0000
commitc36dadd2bdf01b26a3e5598def477b22a0b31e77 (patch)
treec4dc0222d2dcdc21060c7c1da50ce28d97d2a8e1 /src/memblock.c
parent1a6fea24f51dc7e1dc5c0683de6eb9dc9aa8d88b (diff)
remove global exported variables:
pa_memblock statistics pa_default_sample_spec git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@70 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/memblock.c')
-rw-r--r--src/memblock.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/memblock.c b/src/memblock.c
index 2dfa6a9c..17038861 100644
--- a/src/memblock.c
+++ b/src/memblock.c
@@ -5,7 +5,7 @@
#include "memblock.h"
-unsigned pa_memblock_count = 0, pa_memblock_total = 0;
+static unsigned memblock_count = 0, memblock_total = 0;
struct pa_memblock *pa_memblock_new(size_t length) {
struct pa_memblock *b = malloc(sizeof(struct pa_memblock)+length);
@@ -13,8 +13,8 @@ struct pa_memblock *pa_memblock_new(size_t length) {
b->ref = 1;
b->length = length;
b->data = b+1;
- pa_memblock_count++;
- pa_memblock_total += length;
+ memblock_count++;
+ memblock_total += length;
return b;
}
@@ -24,8 +24,8 @@ struct pa_memblock *pa_memblock_new_fixed(void *d, size_t length) {
b->ref = 1;
b->length = length;
b->data = d;
- pa_memblock_count++;
- pa_memblock_total += length;
+ memblock_count++;
+ memblock_total += length;
return b;
}
@@ -35,8 +35,8 @@ struct pa_memblock *pa_memblock_new_dynamic(void *d, size_t length) {
b->ref = 1;
b->length = length;
b->data = d;
- pa_memblock_count++;
- pa_memblock_total += length;
+ memblock_count++;
+ memblock_total += length;
return b;
}
@@ -54,8 +54,8 @@ void pa_memblock_unref(struct pa_memblock*b) {
if (b->type == PA_MEMBLOCK_DYNAMIC)
free(b->data);
- pa_memblock_count--;
- pa_memblock_total -= b->length;
+ memblock_count--;
+ memblock_total -= b->length;
free(b);
}
@@ -79,3 +79,10 @@ void pa_memblock_unref_fixed(struct pa_memblock *b) {
}
}
+unsigned pa_memblock_get_count(void) {
+ return memblock_count;
+}
+
+unsigned pa_memblock_get_total(void) {
+ return memblock_total;
+}