long add;
mem = (void*)malloc(1024 +15);
add = (long)mem;
add = add - (add % 16);//align to 16 byte boundary
ptr = (whatever*)(add);
↧
Answer by Ramana for How to allocate aligned memory only using the standard library?
↧