Hi All,
To align variable or table to 32 byte boundary I use this:
char ch __attribute__((__aligned__(32))); char array[512] a __attribute__((__aligned__(32)));
But I need 32 byte aligned dynamic buffers. So how to tell to the new operator to return 32 byte aligned address?
In this case alignment is ignored.
char * ptr; ptr = new char[buffsize] __attribute__((__aligned__(32)));
So how to do it?
Allocate more than you need and round up the address, saving the original address for when your free()
That's what I'm going to do but looking for more elegant solution.
Aligned new and delete are introduced in C++17 en.cppreference.com/.../operator_new so I hope it will be in Keil soon.