Date: Wed, 12 Mar 1997 08:28:14 +0200 (IST) From: Eli Zaretskii To: "G.P. Tootell" 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: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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.