A strange malloc() problem. HELP? - ahma...@yahoo.com - Apr 2 15:25:42 2008
Hi;
1-In my program I have a function inside which I only using malloc() and an assert() functions.
this function is called many times in the program and as I traced every time it allocates
memory then the v-free() function will free memory. but in one case the function could not get
memory and assert function aborts the program as I see this function gets only 10 words and all
of the .sysmem memory is free. Could you tell me why and help me to trace it?
2- why in CCS the amount of variables are updated one or more steps after running their
instruction line when I trace the code? is there any way to solve this like as is in visual
C/C++ studio?
regards
------------------------------------
Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution
for Commercial & Consumer End Equipment: www.ti.com/dm6467

(You need to be a member of code-comp -- send a blank email to code-comp-subscribe@yahoogroups.com )
Re: A strange malloc() problem. HELP? - Jeff Brower - Apr 2 20:07:51 2008
Ahmad-
> 1-In my program I have a function inside which I only using malloc() and an
> assert() functions. this function is called many times in the program and
> as I traced every time it allocates memory then the v-free() function will
> free memory. but in one case the function could not get memory and assert
> function aborts the program as I see this function gets only 10 words and
> all of the .sysmem memory is free. Could you tell me why and help me to
> trace it?
One suggestion is to follow malloc into its source code and see why it fails. You
can get the C source for malloc from the matching .src file (search your CCS install
folder for *.src files). Once you know the C source you get some idea of what the
asm instructions are doing when you single-step into malloc.
> 2- why in CCS the amount of variables are updated one or more steps after
> running their instruction line when I trace the code? is there any way to
> solve this like as is in visual C/C++ studio?
I think the answer to #2 is pipeline... it takes a few cycles for operations to
actually take place ane memory / register results to appear.
-Jeff
------------------------------------
Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution
for Commercial & Consumer End Equipment: www.ti.com/dm6467

(You need to be a member of code-comp -- send a blank email to code-comp-subscribe@yahoogroups.com )