This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: malloc not available?


"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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]