added functions to allocate aligned and free aligned memory