Skip to content

Instantly share code, notes, and snippets.

@siddontang
Last active October 13, 2015 09:17
Show Gist options
  • Save siddontang/4173360 to your computer and use it in GitHub Desktop.
Save siddontang/4173360 to your computer and use it in GitHub Desktop.
round up
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