modify memory block reference counting to use the new reference counting API

git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1342 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2006-08-29 01:16:47 +00:00
parent 9948cb09a3
commit 327e0cd8e1
3 changed files with 18 additions and 15 deletions

View file

@ -38,9 +38,11 @@ void pa_memchunk_make_writable(pa_memchunk *c, size_t min) {
assert(c);
assert(c->memblock);
assert(c->memblock->ref >= 1);
assert(PA_REFCNT_VALUE(c->memblock) > 0);
if (c->memblock->ref == 1 && !c->memblock->read_only && c->memblock->length >= c->index+min)
if (PA_REFCNT_VALUE(c->memblock) == 1 &&
!c->memblock->read_only &&
c->memblock->length >= c->index+min)
return;
l = c->length;