View previous topic :: View next topic |
Author |
Message |
Guest_X44 Guest
|
malloc() |
Posted: Thu Feb 05, 2004 5:41 pm |
|
|
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
|
|
Posted: Thu Feb 05, 2004 5:48 pm |
|
|
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
|
|
Posted: Thu Feb 05, 2004 10:41 pm |
|
|
Am I missing something here? |
|
|
abs
Joined: 19 May 2004 Posts: 5
|
|
Posted: Thu May 20, 2004 12:25 pm |
|
|
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
|
|
Posted: Tue Jan 10, 2006 3:14 pm |
|
|
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
|
|
Posted: Tue Jan 10, 2006 3:24 pm |
|
|
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 |
|
|
|
|