Alignment in allocator question
Carlos Rafael Giani
dv at pseudoterminal.org
Tue Mar 4 03:23:24 PST 2014
On 2014-03-04 03:54, Nicolas Dufresne wrote:
> Le lundi 03 mars 2014 à 22:47 +0100, Carlos Rafael Giani a écrit :
>> and also read up again that align is actually a bitmask.
>
> I didn't check the code you are referring, but alignment is usually a
> shift, not a mask.
>
> Nicolas
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Well yes. Inside the code, the align value is used for both the
allocation size and the shifting of the pointer, as usual. The odd thing
is that the documentation describes it as a bitmask, and the code tests
that it is a power of two (with the (align&(align-1))==0 check). This is
what I find so strange. Why this complicated solution? Why not just a
plain alignment value?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140304/6163e4f0/attachment.html>
More information about the gstreamer-devel
mailing list