delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/10/03:56:56

Date: Thu, 10 Jun 1999 10:54:22 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Dlanor Blytkerchan <dlanor AT dds DOT nl>
cc: djgpp AT delorie DOT com
Subject: Re: malloc() problem
In-Reply-To: <v01540b01b383d83a2ae0@[145.18.167.138]>
Message-ID: <Pine.SUN.3.91.990610105357.17697F-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Wed, 9 Jun 1999, Dlanor Blytkerchan wrote:

> I'm thinking of going around it
> by stubifying my program and putting it in pmodstub.exe - if I understand
> the docs correctly, that should work.

PMODE should work, but it disables virtual memory.  Since you have a
memory-starved system, are you sure you want it?

> A weird thing is, though, that the
> test sources I downloaded from simtel for DJGPP, where malloc() is also
> used without calling CWSDPMI externally first, do work.

I don't follow.  Which test sources did you donwload, and how are they
different from what your failing program does.

> My only remaining
> idea for the cause of this problem is that malloc simply won't do anything
> as "large" as 34K from the program I'm writing: trying it with a smaller
> struct does work.

`malloc' doesn't care much about the size of the chunk you are
requesting.  The failure comes from passing the request via `sbrk' to
the DPMI server and, eventually, to the extended memory manager.

> If anyone has some real-life source that does this and does work,
> preferably ANSI C, but C++ will do as well, I would be much obliged.

Well, I have a real-life source called ``Emacs'' that allocates gobs
of memory in chunks that are usually much larger than 34KB, eventually
stabilizing at [checking] 25MB if I work long enough (this one was
running for a week without shutting it down), and I never had any
problems with it.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019