summaryrefslogtreecommitdiff
path: root/src/pulsecore/memblock.c
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2006-08-22 07:41:23 +0000
committerPierre Ossman <ossman@cendio.se>2006-08-22 07:41:23 +0000
commitd964459a649ff8c8d73388bc810a2ea629abe5c9 (patch)
tree73a3ad8fb641504a4d9ad3743861c168a02c73e1 /src/pulsecore/memblock.c
parent7bc71103fb51609edfb0d7893344871a00f1221d (diff)
Fix detection of page size for non-POSIX systems.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1312 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/pulsecore/memblock.c')
-rw-r--r--src/pulsecore/memblock.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/pulsecore/memblock.c b/src/pulsecore/memblock.c
index c34ddee5..9e5c5b81 100644
--- a/src/pulsecore/memblock.c
+++ b/src/pulsecore/memblock.c
@@ -443,8 +443,14 @@ pa_mempool* pa_mempool_new(int shared) {
p = pa_xnew(pa_mempool, 1);
+#ifdef HAVE_SYSCONF
ps = (size_t) sysconf(_SC_PAGESIZE);
-
+#elif defined(PAGE_SIZE)
+ ps = (size_t) PAGE_SIZE;
+#else
+ ps = 4096; /* Let's hope it's like x86. */
+#endif
+
p->block_size = (PA_MEMPOOL_SLOT_SIZE/ps)*ps;
if (p->block_size < ps)