Use a function for aligned memory allocations

...instead of doing this manually.