summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/memblock.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2006-08-29 02:01:39 +0000
committerLennart Poettering <lennart@poettering.net>2006-08-29 02:01:39 +0000
commit5264d235d25f04d3cd5796e751a66cb92453be73 (patch)
treed39ba9a925b0cd2bbc57265e66536bdafe414fc8 /src/pulsecore/memblock.h
parent327e0cd8e1e81999dd855e38d3cb3b414aeadc7a (diff)
make pa_mempool_stat thread-safe/lock-free
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1343 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/pulsecore/memblock.h')
-rw-r--r--src/pulsecore/memblock.h32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/pulsecore/memblock.h b/src/pulsecore/memblock.h
index 60a0c900..d4f2b7aa 100644
--- a/src/pulsecore/memblock.h
+++ b/src/pulsecore/memblock.h
@@ -74,21 +74,25 @@ struct pa_memblock {
} per_type;
};
+/* Please note that updates to this structure are not locked,
+ * i.e. n_allocated might be updated at a point in time where
+ * n_accumulated is not yet. Take these values with a grain of salt,
+ * threy are here for purely statistical reasons.*/
struct pa_mempool_stat {
- unsigned n_allocated;
- unsigned n_accumulated;
- unsigned n_imported;
- unsigned n_exported;
- size_t allocated_size;
- size_t accumulated_size;
- size_t imported_size;
- size_t exported_size;
-
- unsigned n_too_large_for_pool;
- unsigned n_pool_full;
-
- unsigned n_allocated_by_type[PA_MEMBLOCK_TYPE_MAX];
- unsigned n_accumulated_by_type[PA_MEMBLOCK_TYPE_MAX];
+ AO_t n_allocated;
+ AO_t n_accumulated;
+ AO_t n_imported;
+ AO_t n_exported;
+ AO_t allocated_size;
+ AO_t accumulated_size;
+ AO_t imported_size;
+ AO_t exported_size;
+
+ AO_t n_too_large_for_pool;
+ AO_t n_pool_full;
+
+ AO_t n_allocated_by_type[PA_MEMBLOCK_TYPE_MAX];
+ AO_t n_accumulated_by_type[PA_MEMBLOCK_TYPE_MAX];
};
/* Allocate a new memory block of type PA_MEMBLOCK_MEMPOOL or PA_MEMBLOCK_APPENDED, depending on the size */