AnsweredAssumed Answered

Memory returned by 'malloc' function is not word aligned

Question asked by rahul.mohan on Apr 7, 2017
Latest reply on Apr 18, 2017 by Kader.M

Hi All,

 

I am developing an audio application on ADSP-21489 platform. For dynamically allocating a large pool of memory, used C-run-time library function 'malloc'.

The C/C++ Compiler Manual for SHARC Processors specifies that - "functions such as malloc() only return double-word
aligned memory". But when I checked the pointer returned by my malloc call, it seems like only byte aligned. 

 

Is there any way to specify that the malloc function should return word aligned memory ?

 

Tool chain details:

  CrossCore Embedded Studio 2.4.0.201609201624

  C/C++ Development Tooling Source 8.7.0.201506070905 

  C/C++ Development Tools 8.7.0.201506070905

  C/C++ Compiler : SHARC version 8.8.0.0 (Aug 26 2016 18:45:47), BUILD-B-REL-CCES2_4-20160826_1812

Outcomes