I've noticed that your code is Visual Studio specific at the moment, so I'll give you a few tips you can use to make it more standard and portable.
#pragma onceis not standard, but it is supported by several compilers, so this is not an issue. Just for the record, an option to it would be an include guard.__int32and__int8are Microsoft specific. C++11 provides the header<cstdint>, which defines several sized integral types, includinguint32_tanduint8_t. You should use those instead.__alignofis a pre-C++11 Visual Studio extension. The new C++ standard now provides thealignofoperator, which should be used instead._aligned_malloc()is also a Windows specific function, its Unix equivalent beingmemalign()orposix_memalign(). Your best course of action here would be to avoid calling_aligned_malloc()directly by creating a thin wrapper function that you can redirect tomemalign/_aligned_malloceasily with some#ifdefs, in case you ever decide to port this code. See this SO questionthis SO question for more.