Skip to content

Instantly share code, notes, and snippets.

@zerojiu
Last active April 24, 2017 02:57
Show Gist options
  • Save zerojiu/5673c6c1cbb21408100381b6cfa07fc5 to your computer and use it in GitHub Desktop.
Save zerojiu/5673c6c1cbb21408100381b6cfa07fc5 to your computer and use it in GitHub Desktop.
Macro definition of memory operation
/* Given a size, round up to aligenment sizeof(void*) */
#define MAX_ALIGNMENT 4
#define ROUND_UP_TO_ALIGNMENT_SIZE(x) (((x) + MAX_ALIGNMENT - 1u) & ~(MAX_ALIGNMENT - 1u))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment