This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: About malloc() ....
- To: "Jonathan Larmour" <jlarmour at redhat dot co dot uk>,"Alexandre D'Alton" <r9954c at email dot sps dot mot dot com>
- Subject: Re: [ECOS] About malloc() ....
- From: tim at cygnetinc dot com (Tim Michals)
- Date: Mon, 24 Jul 2000 08:55:33 -0500
- Cc: <ecos-discuss at sourceware dot cygnus dot com>
- References: <3975D801.270C1297@email.sps.mot.com> <3975DB49.C355E349@redhat.co.uk>
> Out of interest, I don't know any systems where increasing the thread
stack
> size increases the memory pool available to malloc().
Yes, Windows in the early days, they used a near heap concept, near heap is
define a the bottom of the stack pointer to the end of BSS. This is a
dangerous operation. Also, DOS did the same think on memory models small
and compact.
Tim
----- Original Message -----
From: Jonathan Larmour <jlarmour@redhat.co.uk>
To: Alexandre D'Alton <r9954c@email.sps.mot.com>
Cc: <ecos-discuss@sourceware.cygnus.com>
Sent: Wednesday, July 19, 2000 11:46 AM
Subject: Re: [ECOS] About malloc() ....
> Alexandre D'Alton wrote:
> >
> > I would like to know what are the requirements for the malloc()
> > function.
> >
> > I have created a thread who calls the malloc() function, after 3 calls
> > with a size of 0x1000h, it returns NULL. The stack size allocated to
> > this thread is 4000000 !!!
> >
> > Can somebody explain me this strange behaviour ?
>
> The malloc implementation in the current releases is a bit dumb. You have
> to configure the size of the malloc pool in the configuration - look in
> your configuration under libc for "Size of the dynamic memory pool in
> bytes" (aka CYGNUM_LIBC_MALLOC_MEMPOOL_SIZE).
>
> Out of interest, I don't know any systems where increasing the thread
stack
> size increases the memory pool available to malloc().
>
> For what it's worth, I've already fixed all this up so that malloc() can
> use all available memory on all systems for its heap, and also ported
> dlmalloc as an additional implementation, but I haven't had a chance to
> make it public yet. Soon....
>
> > Ho, my architecture is MPC860 with 32meg of sdram and i am using ecos
> > v1.2.1 because I have not enought time to begin the 1.3.1 port to my
> > board.
>
> That's a shame.
>
> Jifl
> --
> Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS Tel: +44 (1223)
728762
> "Plan to be spontaneous tomorrow." || These opinions are all my own
fault