X-Authentication-Warning: mail.bio.uva.nl: Host biomacI-138.bio.uva.nl [145.18.167.138] claimed to be [145.18.167.138] X-Sender: dlanor AT dds DOT nl (Unverified) Message-Id: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Wed, 9 Jun 1999 10:44:54 +0200 To: djgpp AT delorie DOT com From: dlanor AT dds DOT nl (Dlanor Blytkerchan) Subject: Re: malloc() problem Reply-To: djgpp AT delorie DOT com >>>> When I started the program it died with "Load error: no >>>> DPMI memory". >>>This is one more evidence that your system runs out of memory somehow. >>>This message is printed when the stub loader cannot allocate enough >>>memory to load the code and static data of your program. >> .. which it probably tries to do with malloc() >No, the startup code uses direct DPMI calls to get the memory at that >stage, since the program's segments are not yet set up, and so calling >`malloc' would crash immediately. OK. But that still leaves the same problem. 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. 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. 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. I am now convinced that it is not a lack of memory that is at fault here: I've called go32-v2 as well as mem to see how much memory I've got left - it is still far more than the 34 K I want. 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. Greetz! Dlanor