www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/01/02:23:44

From: sandmann AT clio DOT rice DOT edu (Charles Sandmann)
Message-Id: <9804010716.AA15273@clio.rice.edu>
Subject: Re: djgpp malloc and freeing memory on exit
To: eldredge AT ap DOT net (Nate Eldredge)
Date: Wed, 1 Apr 1998 01:16:59 -0600 (CST)
Cc: eliz AT is DOT elta DOT co DOT il, edc AT arches DOT uga DOT edu, djgpp AT delorie DOT com
In-Reply-To: <199804010555.VAA22806@adit.ap.net> from "Nate Eldredge" at Mar 31, 98 09:55:33 pm

> >   free them all (it's current CS/SS for example).
> 
> This might be totally wrong, but from my reading of the exit code, it sure
> tries. It looks like it writes some 16-bit code to its transfer buffer whose
> job is to free the last selectors and memory block. Since this runs in real
> mode, it shouldn't need any selectors of its own. Am I missing something?

It does not run in real mode - it runs in 16-bit protected mode, and thus
still has selectors for CS, SS, env and PSP.  Freeing any of those will
cause certain DPMI providers to crash.

> Do I understand correctly that, barring a bug in the DPMI server, selectors
> and such will be freed when the *parent* exits?

Yes, this is correct.  Occassionally Windows gets confused and loses them
anyway - in which case it's time to reboot.

- Raw text -


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