Skip to content

Instantly share code, notes, and snippets.

@Varriount
Created May 4, 2014 03:07
Show Gist options
  • Save Varriount/b35bb90a650ce03de235 to your computer and use it in GitHub Desktop.
Save Varriount/b35bb90a650ce03de235 to your computer and use it in GitHub Desktop.
proc alignedBuffer(size = 4000): pointer =
result = alloc0(buffer)
if cast[int](result) mod 32 != 0:
echo("Warning: Memory buffer not on a 32 byte boundary.")
echo("Memory aligned.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment