www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/12/22/01:38:03

From: Charles Sandmann <sandmann AT new-orleans DOT NeoSoft DOT com>
Subject: QDPMI VM memory bug
To: djgpp AT sun DOT soe DOT clarkson DOT edu (DJGPP Mailing List)
Date: Thu, 22 Dec 1994 00:24:25 -0600 (CST)

Okay, I checked it out, and this is the problem:

1) DJGPP (V1.x and V2.0) use the resize memory block DPMI API to increase
   the program size on an sbrk() - on calls to malloc(), etc.
2) QDPMI fails on resize requests if they would exceed the real memory
   capacity.  DPMI 0x0503 is the call that gives it problems.

Note, QDPMI VM does seem to work OK for me if I initially allocate 
the larger amount of memory.  For example, I just allocated 40Mb of
virtual memory with QDPMI a few moments ago.

Potential solutions:
 1) On a resize under QDPMI, write all memory to a file, free the memory
    block, allocate a new one, read memory from file (EXTREMELY SLOW).
 2) Define a minimum memory size big enough to handle the program.  Since
    DPMI does not commit pages until they are touched, this isn't too
    bad oversizing.  You can never resize up in this case.

Under NT 3.1 early betas, I had to do 2) to make GO32 work there, since
it botched resizes also.

How to determine and specify a max size for each program is a mess, and
I am not sure I want to think about it too much.  Anyway, there is a 
potential fix for those needing QDPMI.  Is the pain worth the gain?
You decide.

- Raw text -


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