This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: malloc not available?
- To: "Trenton D. Adams" <tadams at extremeeng dot com>
- Subject: Re: [ECOS] malloc not available?
- From: Jonathan Larmour <jlarmour at redhat dot com>
- Date: Thu, 11 Oct 2001 00:14:11 +0100
- Cc: "'eCos Discussion'" <ecos-discuss at sourceware dot cygnus dot com>
- References: <000901c151c5$c12bb9c0$090110ac@TRENT>
"Trenton D. Adams" wrote:
>
> Is the standard malloc available somewhere? Do I have to download it
> separately from the repository? I included <sys/malloc.h> but I get the
> error below. The malloc () I know only takes one argument~
sys/malloc.h is one of those include file space polluting headers from the
net stack. Ignore it. The ISO C standard says you get malloc() from
<stdlib.h>
> /cygdrive/C/MyDocuments/eCosRepository/ecos/packages/devs/eth/wavelan/cu
> rrent/src/if_wvlan.c:345: macro `malloc' used with just one arg
> make[1]: Leaving directory
> `/c/MyDocuments/eCosBuilds/RAMSupport_build/devs/eth/wavelan/current'
>
> The eCos Reference manual says I can use the standard C Library malloc
> () call, but I don't see how since malloc.h is only implemented in the
> net package as far as I can tell.
services/memalloc/common but just include <stdlib.h> instead.
NB using dynamic allocation in a driver is generally frowned upon in an
embedded system (non-deterministic etc.).
Jifl
--
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine