CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Malloc and free

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Flavio58



Joined: 08 Sep 2003
Posts: 21

View user's profile Send private message

Malloc and free
PostPosted: Fri Jun 06, 2003 5:08 am     Reply with quote

When I try to use the dynamic allocation methods and free the compiler show me an error in stdlibm.h ....
To use malloc and free I must to include this file ....
This error is :

Error[12] C:\PROGRA~1\PICC\drivers\memmgmt.c 56 : Undefined identifier __DYNAMIC_HEAD

The __DYNAMIC_HEAD is not defined....
Do you known how is possible to use the free function ?
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515060
R.J.Hamlett
Guest







Re: Malloc and free
PostPosted: Fri Jun 06, 2003 5:54 am     Reply with quote

:=When I try to use the dynamic allocation methods and free the compiler show me an error in stdlibm.h ....
:=To use malloc and free I must to include this file ....
:=This error is :
:=
:=Error[12] C:\PROGRA~1\PICC\drivers\memmgmt.c 56 : Undefined identifier __DYNAMIC_HEAD
:=
:=The __DYNAMIC_HEAD is not defined....
:=Do you known how is possible to use the free function ?
Yes, it works.
The question is which compiler version you have?. For example, the demo code will compile fine on V3.160, and back as early as about 3.114, but on 3.110, will give the error you are quoting.
Any version that comes with the example, should not give this error. The compiler seems to create this variable without being asked. Is it possible you are changing one of the other include files, and preventing this?. Have you tried compiling the example 'as is'?.
The code that is generated, seems 'reasonable'.
What chip are you trying to compile for?. Though some of the files used, mention PCB, most only refer to PCM or PCH. So far, this demo will not compile for me, on any chip using the PCB compiler.

Best Wishes
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515062
Lance Lascari
Guest







Re: Malloc and free
PostPosted: Fri Jun 06, 2003 6:30 am     Reply with quote

I've seen malloc work, but it doesn't work in my application.

I finally ended up sending my code to support but I haven't yet heard. In my case it would intermittently work with various power-cycling-conditions. It seems that it somehow is affected by other stuff in ram because it would ALWAYS fail for me if I tried #ZERO_RAM.

Hopefully I'll hear from them on what the deal is...

Anyone else made it work? I didn't get an answer when I asked before myself.

I'm trying to use it with PCH, btw.

Lance


:=:=When I try to use the dynamic allocation methods and free the compiler show me an error in stdlibm.h ....
:=:=To use malloc and free I must to include this file ....
:=:=This error is :
:=:=
:=:=Error[12] C:\PROGRA~1\PICC\drivers\memmgmt.c 56 : Undefined identifier __DYNAMIC_HEAD
:=:=
:=:=The __DYNAMIC_HEAD is not defined....
:=:=Do you known how is possible to use the free function ?
:=Yes, it works.
:=The question is which compiler version you have?. For example, the demo code will compile fine on V3.160, and back as early as about 3.114, but on 3.110, will give the error you are quoting.
:=Any version that comes with the example, should not give this error. The compiler seems to create this variable without being asked. Is it possible you are changing one of the other include files, and preventing this?. Have you tried compiling the example 'as is'?.
:=The code that is generated, seems 'reasonable'.
:=What chip are you trying to compile for?. Though some of the files used, mention PCB, most only refer to PCM or PCH. So far, this demo will not compile for me, on any chip using the PCB compiler.
:=
:=Best Wishes
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515063
Flavio58



Joined: 08 Sep 2003
Posts: 21

View user's profile Send private message

Re: Malloc and free
PostPosted: Mon Jun 09, 2003 2:33 am     Reply with quote

The problem is not the free or malloc function but the errror that my compiler show me when I include the stdlibm.h in my projects...
I use the last relase (3.160 - PCH)....

Executing: "C:\Programmi\PICC\Ccsc.exe" "SkyMilCtrl.c" "-I C:\Programmi\PICC\Drivers" +FH +DF +LN +T +A +M -Z +ICD +Y=9 +FH
Error[12] C:\PROGRA~1\PICC\drivers\memmgmt.c 56 : Undefined identifier __DYNAMIC_HEAD
Skipping link step. Not all sources built successfully.
BUILD FAILED

In this include there is the __DYNAMIC_HEAD that is not defined ...
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515103
R.J.Hamlett
Guest







Re: Malloc and free
PostPosted: Mon Jun 09, 2003 4:50 am     Reply with quote

:=The problem is not the free or malloc function but the errror that my compiler show me when I include the stdlibm.h in my projects...
:=I use the last relase (3.160 - PCH)....
:=
:=Executing: "C:\Programmi\PICC\Ccsc.exe" "SkyMilCtrl.c" "-I C:\Programmi\PICC\Drivers" +FH +DF +LN +T +A +M -Z +ICD +Y=9 +FH
:=Error[12] C:\PROGRA~1\PICC\drivers\memmgmt.c 56 : Undefined identifier __DYNAMIC_HEAD
:=Skipping link step. Not all sources built successfully.
:=BUILD FAILED
:=
:=In this include there is the __DYNAMIC_HEAD that is not defined ...

As I have said, it appears to be created automatically. I'd suspect the line '#USE DYNAMIC_MEMORY".
However you are still trying to compile your code 'SkyMilCtrl'. Go back to the question, does the demo itself compile?. On this version for me, it does. Once you have this working, you then have to find out what is different. If it doesn't, then it would possibly imply that one of the command line options is actually interfering with this function.

Best Wishes
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515104
btokarchuk
Guest







Re: Malloc and free
PostPosted: Tue Jun 24, 2003 2:03 pm     Reply with quote

:=When I try to use the dynamic allocation methods and free the compiler show me an error in stdlibm.h ....
:=To use malloc and free I must to include this file ....
:=This error is :
:=
:=Error[12] C:\PROGRA~1\PICC\drivers\memmgmt.c 56 : Undefined identifier __DYNAMIC_HEAD
:=
:=The __DYNAMIC_HEAD is not defined....
:=Do you known how is possible to use the free function ?

This may not help you, but i have the same problem. Though through moving the #include <STLIBM.H> directive around i found that it now compiles if i put this IMMEDIATELY after the #use RS232 line in my main.h file. I have yet to check to see if this actually works once it's running but at least it compiles now.

Brent.
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515538
Guest_X44
Guest







PostPosted: Sat Feb 07, 2004 10:44 pm     Reply with quote

I still have the same problem with CCS compiler ver. 3.173.
Could anyone out there help me out on this.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group