Apr 26, 2022

[algorithm] binary arithmetic for power of 2 alignment

Reference:
https://sites.google.com/site/theoryofoperatingsystems/labs/malloc/align8


i.e.

align(a, x) = (x + a - 1) & ~(a-1)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.