Re: malloc() fails: 32MB heap limit and how to work around?

Ilya Zakharevich <nospam-abuse-qlYHBhoNh+/[email protected]> Sun, 19 Oct 2003 18:55:48 -0700
Newsgroups gmane.comp.ide.emx.devel
Message-ID <[email protected]>
On Sun, Oct 19, 2003 at 11:05:14PM +0200, Thomas Hoffmann wrote:
> That's an EMX feature. Usually EMX applications are limited to
> using a 32MB heap

Bullocks.  EMX programs can use as much memory as is available via
low-memory user memory space.

> _UF_SBRK_CONTIGUOUS sbrk() always allocates contiguous memory; the size 
> of the heap is
> limited to the initial heap size.  This is the initial setting; however, 
> the malloc() implementation of emx
> selects _UF_SBRK_ARBITRARY

Actually, this means that the default for programs which *do not* use
EMX's malloc() (and do not call CRT library entry points which use
EMX's malloc()) is *not* _UF_SBRK_ARBITRARY.

_UF_SBRK_ARBITRARY is set during the first invocation of malloc().
E.g., all Perl (which uses its own malloc()) needs to do is

    _uflags (_UF_SBRK_MODEL, _UF_SBRK_ARBITRARY);

Hope this helps,
Ilya