<div dir="ltr">It's a bitmask and it checks ((align&(align+1))==0). The reason for the bitmask is that it is easy to combine alignments, you can just or them together to get the max required alignment. <div><br></div>
<div>Wim</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 4 March 2014 12:23, Carlos Rafael Giani <span dir="ltr"><<a href="mailto:dv@pseudoterminal.org" target="_blank">dv@pseudoterminal.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF"><div><div class="h5">
    <div>On 2014-03-04 03:54, Nicolas Dufresne
      wrote:<br>
    </div>
    </div></div><blockquote type="cite"><div><div class="h5">
      
      
      Le lundi 03 mars 2014 à 22:47 +0100, Carlos Rafael Giani a écrit :<br>
      <blockquote type="CITE"> and also read up again that align is
        actually a bitmask.<br>
      </blockquote>
      <br>
      I didn't check the code you are referring, but alignment is
      usually a shift, not a mask.<br>
      <br>
      Nicolas
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><div class=""><pre>_______________________________________________
gstreamer-devel mailing list
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
</pre>
    </div></blockquote>
    <br>
    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?<br>
  </div>

<br>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br></blockquote></div><br></div>