mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-05 13:29:57 -05:00
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:
parent
33e5802df2
commit
3d6092bb0f
16 changed files with 52 additions and 40 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue