env: EVM6446 + XDS560
I define an array in codec using malloc, and then I debug my codec, but when I step at "to free the array" code line, I find that I can't debug any more, because I can not find the "yellow arrow" in CCS, I don't know where it is after stepping at "free" code line.
here is my code example in codec:
XDAS_Int32 XXX_XXX_process (....)
{
.........................
f1();
..........................
}
void f1()
{
//here I want to define an array using malloc
char* tmparray = 0;
tmparray = (char*) calloc(720*576,sizeof(char)); /*I'm sure that "tmparray" is not NULL here*/
// here I use "tmparray" to calculate some values.
..................
// After using it, I use "free" function to avoid memory leak.
free(tmparray);
// But after stepping at " free(tmparray);", I press "F10" and then the "yellow arrow" disappears.
// and I can not debug the codec.
}
So I wonder I should consider to use other function to apply blocks of memory space in codec.
[edit] I've read a post in community, from Bernie's first response I learn that I can use malloc or calloc to apply memory space in c64+. Do I need to free these memory spaces after using it to calculate?
I think if I need to free them, my strange question above will occur.
Merry Christmas :)