Use posix_memalign and _aligned_malloc for alignment. Remove unused code.