[pulseaudio-discuss] Purpose of 8-byte buffer alignment in cpu-mix-test.c

Tanu Kaskinen tanuk at iki.fi
Sat Nov 19 17:56:24 UTC 2016


On Sat, 2016-11-19 at 19:21 +0200, Tanu Kaskinen wrote:
> Hi Peter!
> 
> Do you happen to remember why the audio buffers in run_mix_test() in
> src/tests/cpu-mix-test.c are forced to have 8-byte alignment? I plan to
> replace the stack-allocated buffers with regular memblocks, and the
> memblock backing memory is only aligned to 4 bytes on 32-bit machines.
> It's possible to still have the old alignment behaviour, but that
> requires extra code, and if 4-byte alignment is equally fine, then I'd
> prefer to avoid the extra code.

Also, why is the alignment so carefully controlled? All tests are run
on a buffer that begins one sample after the 8-byte alignment boundary.
Is this done to catch bugs related to weird (but valid) sample
alignments?

-- 
Tanu

https://www.patreon.com/tanuk


More information about the pulseaudio-discuss mailing list