Last active
October 13, 2015 09:17
-
-
Save siddontang/4173360 to your computer and use it in GitHub Desktop.
round up
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int align = 8; | |
size_t round_up(size_t bytes) | |
{ | |
return ((bytes) + align - 1) & ~(align - 1) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment