AnsweredAssumed Answered

How to enforce double word alignment with heap allocation?

Question asked by Jaco on Jul 14, 2010
Latest reply on Jul 14, 2010 by dsmtoday

Hi,

 

My C++ project is for a SHARC 21479 DSP.

 

How can I enforce that the memory alignment of arrays allocated on the heap are on double word boundaries?

 

For example:

 

float* arr = new float[2048];

or

float* arr = new(heapID) float [8192]; // for large arrays allocated in external memory heap.

 

As far as I understand the default alignment for the above case will be that of sizeof(float) which is single word (32 bits) alignment. I need to have them allocated on double word (64-bit) boundaries.

 

Regards

Jaco

Outcomes