Hi!
I am working on 6678 multicore processor.
I want to compare the memory overhead caused when data is allocated in shared memory and DDR3 .
I used malloc to allocate an array. but the allocation failed. still the code runs till the end.
Here is my code:
#include <stdio.h>
#include <stdlib.h>
void main(void)
{
int i,j;
short * IpBuffer;
IpBuffer = (short *)malloc(512*512*sizeof(short));
for (i=0; i<5000;i++)
{
for (j=0;j<5000;j++)
{
*(IpBuffer +i+2) = *(IpBuffer + i)+ *(IpBuffer + i+1);
*(IpBuffer +2*i+2) = *(IpBuffer + 2*i)+ *(IpBuffer +3* i+1);
*(IpBuffer +3*i+2) = *(IpBuffer + 3*i)+ *(IpBuffer + 2*i+1);
*(IpBuffer +2*i+1) = *(IpBuffer + 2+i)+ *(IpBuffer +3* i+1);
}
}
}
As per my knowledge malloc allocates array in heap, but in the cmd file I have not specified where this heap should be allocated. How can that be specified?
I tried with .sysmem and .data extensions, but it did'nt work.
Also, how can I ensure that code is compiled in debug mode
regards,
Sohal