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
This commit is contained in:
Pierre Ossman 2006-08-22 07:41:23 +00:00
parent 7bc71103fb
commit d964459a64
2 changed files with 9 additions and 2 deletions

View file

@ -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)