starting to replace posix_memalign with something C99 compatible