delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/12/01:47:29

Date: Wed, 12 Mar 1997 08:28:14 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "G.P. Tootell" <gpt20 AT thor DOT cam DOT ac DOT uk>
cc: djgpp AT delorie DOT com
Subject: Re: problem with malloc in djgpp?
In-Reply-To: <5g491r$mbg@lyra.csx.cam.ac.uk>
Message-ID: <Pine.SUN.3.91.970312082447.3808A-100000@is>
MIME-Version: 1.0

On 11 Mar 1997, G.P. Tootell wrote:

> on startup the program claims (under pure dos) that it has 0.7meg real and 121meg
> virtual memory available.

What kind of system setup do you use?  If you have 8 or 16MB of RAM, how 
come DJGPP only sees 0.7MB free?  Did you install a huge disk cache 
and/or RAM disk?

> now i get 7.1meg real and 120meg virtual available. this should be enough to 
> allocate the 14meg buffer that i require though. 
> dpmi_free_memory, or whatever the hugely long name for it is, says it has
> 127.1meg total therefore. but malloc returns a null pointer when i try to dim the
> block. why on earth should this be the case?

That's because the value returned by `_go32_dpmi_remaining_virtual_memory' 
*includes* the free physical memory.  When you add the two, you get 
larger amount than what you actually have, so `malloc' fails.

- Raw text -


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