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()

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







malloc()
PostPosted: Thu Feb 05, 2004 5:41 pm     Reply with quote

Using malloc() gives me an error: Undefined identifier __DYNAMIC_HEAD


#include <stdlibm.h> is included


When compiling it opens up the file memmgmt.c and this is where the identifier __DYNAMIC_HEAD is located.

Why is is that it doesn't give an error of Undefined identifier for NULL as well, which is also in memmgmt.c ?

NULL, I realize, must be defined in CCS C.

Looking at the <stdlibm.h> file, the __DYNAMIC_HEAD is not defined.


Any thoughts?
Guest_X44
Guest







PostPosted: Thu Feb 05, 2004 5:48 pm     Reply with quote

NULL is actually defined in another called in <stddef.h>

But the __DYNAMIC_HEAD is not defined. I can't find it, anyway.
Guest_X44
Guest







PostPosted: Thu Feb 05, 2004 10:41 pm     Reply with quote

Am I missing something here?
abs



Joined: 19 May 2004
Posts: 5

View user's profile Send private message Visit poster's website

PostPosted: Thu May 20, 2004 12:25 pm     Reply with quote

Do you have the USE DYNAMIC_MEMORY directive?

I believe you need this directive to instruct the compiler to create the __DYNAMIC_HEAD object.

I placed the following directive at the top of my program, after the device directives:

#pragma USE DYNAMIC_MEMORY
Guest








PostPosted: Tue Jan 10, 2006 3:14 pm     Reply with quote

abs wrote:
Do you have the USE DYNAMIC_MEMORY directive?

I believe you need this directive to instruct the compiler to create the __DYNAMIC_HEAD object.

I placed the following directive at the top of my program, after the device directives:

#pragma USE DYNAMIC_MEMORY


BLOODY HELL!!! Why isn't this in the help file??!!!!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Jan 10, 2006 3:24 pm     Reply with quote

The current version of EX_MALLOC.C has the following line in it,
near the start of the file:
Code:
// Includes the functionality for malloc()
#include <STDLIBM.H>


Then, in STDLIBM.H, it has these lines near the top:
Code:
#ifndef _STDLIBM
#define _STDLIBM
#USE DYNAMIC_MEMORY
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