www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/06/03:40:55

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: failed malloc/callocs :(
Date: Mon, 05 May 1997 21:28:47 +0000
Organization: Two pounds of chaos and a pinch of salt
Lines: 34
Message-ID: <336E510F.310F@cs.com>
References: <5ki242$qe8 AT bore DOT pipex DOT net> <336CF825 DOT 5F47 AT cs DOT com> <5kklof$gg8 AT bore DOT pipex DOT net>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp108.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

nikki wrote:
> 
> true, but it gives no clue as to why it failed. surely when you have 120 meg
> of virtual memory it's no big deal to ask for 9meg of that? and even on a 16meg
> machine there should be that amount of real memory. is it perhaps better to
> ask for it in smaller chunks rather than as one contiguous block? i just fail
> to understand why it could fail when it had so much available to it.

I have no idea why this could be happening if you really do have that
much memory.  Certainly, _go32_dpmi_remaining_virtual_memory() isn't
going to help you solve it.  ;)  Hmm... well, here are some
possibilities:

 - You're running your program under Win95 with a low DPMI memory
allocation for DOS programs.  Edit the DOS box properties sheet and
increase the DPMI memory setting (you can type in up to 65535k).
 - You're losing a large amount of memory due to malloc()'s internal
rounding.  malloc() rounds all memory requests to the next higher power
of 2, meaning that if you ask for five 9 megabyte blocks, you'll really
be getting five 16 meg blocks.
 - You're running under a crippled DPMI host like QDPMI from QEMM v7.52
or earlier, which had known problems with virtual memory.
 - You're using the PMODE extender, which does not support virtual
memory.
 - You have turned off the use of virtual memory in your program by
setting the _CRT0_FLAG_LOCK_MEMORY flag or using cwsdpr0 as your DPMI
host.

-- 
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I |     mailto:fighteer AT cs DOT com      |
| Descent 2: The Infinite Abyss - The greatest Internet game of all |
| time just got better!  This time, you're going all the way down...|
---------------------------------------------------------------------

- Raw text -


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