memblock: Add pa_memblock_acquire_chunk().

Besides making the code a bit cleaner, this also gets rid of
a few "cast increases required alignment of target type"
warnings.
This commit is contained in:
Tanu Kaskinen 2012-08-17 18:09:34 +03:00 committed by Tanu Kaskinen
parent 33e5802df2
commit 3d6092bb0f
16 changed files with 52 additions and 40 deletions

View file

@ -459,6 +459,13 @@ void* pa_memblock_acquire(pa_memblock *b) {
return pa_atomic_ptr_load(&b->data);
}
/* No lock necessary */
void *pa_memblock_acquire_chunk(const pa_memchunk *c) {
pa_assert(c);
return (uint8_t *) pa_memblock_acquire(c->memblock) + c->index;
}
/* No lock necessary, in corner cases locks by its own */
void pa_memblock_release(pa_memblock *b) {
int r;