EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Crossworks (malloc.h memory.h)

Started by "zarko.nikolic" April 9, 2008
I am trying to use an FFT library in my Crossworks project.
The FFT library uses malloc.h and memory.h but they do not exist in
Crossworks.

Is there a way to use to use this FFT library since malloc.h and
memory.h don't exist?

An Engineer's Guide to the LPC2100 Series

Hi,

> I am trying to use an FFT library in my Crossworks project.
> The FFT library uses malloc.h and memory.h but they do not exist in
> Crossworks.
>
> Is there a way to use to use this FFT library since malloc.h and
> memory.h don't exist?

Even though the headers may not exist, I assume malloc.h is no more than a
declaration of malloc() and friends. I could conjecture that memory.h gets
you the mem* routines...

What exactly is needed? These are non-standard headers. will
get you malloc and will get you mem*.

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors

--- In l..., "zarko.nikolic" wrote:
>
> I am trying to use an FFT library in my Crossworks project.
> The FFT library uses malloc.h and memory.h but they do not exist in
> Crossworks.
>
> Is there a way to use to use this FFT library since malloc.h and
> memory.h don't exist?
>

?? Quick cut & paste from my own, working, Crossworks app:

*******************************************************************
handle OScreateThread(void *startAddr, int stackSize, unsigned char
priority,
void *parameter){
OSthreadHandle *thisThreadHandle;
thisThreadHandle=(OSthreadHandle*)malloc(sizeof(OSthreadHandle));
thisThreadHandle->stackPtr=(void*)malloc(stackSize<<2);

ctl_task_run(&thisThreadHandle->threadControlStruc,priority,startAddr,parameter,"",
stackSize, thisThreadHandle->stackPtr,CALLSTACKSIZE);
return (void*)thisThreadHandle;
};
*******************************************************************

So, malloc() must be declared in one of the headers, somewhere. Try
stdlib.h

Rgds,
Martin


Memfault Beyond the Launch