www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/11/19/01:30:37

From: Charles Sandmann <sandmann AT new-orleans DOT NeoSoft DOT com>
Subject: Re: stack segment
To: baca AT crl DOT ucsd DOT edu (Kevin Baca)
Date: Fri, 18 Nov 1994 15:00:57 -0600 (CST)
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu

> using malloc() to allocate stack frames).  Well, under plain dos,
> it seams GO32 sets ds and ss to point to the same descriptor.  Under
> Windows, however, they point to different selectors.  Why is this?

Under DPMI, GO32 allocates a separate SS selector with the same base,
but an expand down limit.  It is done this way for safety, since you
can't know how large the stack should be.  Under DPMI we start off with
a 256K stack, but this may not be enough for some applications.  Without
the expand down limit, it would overwrite data and you would never
know about it.  With the limit, you get a stack fault.

If you don't need the safety feature, or it gets in the way (as it
seems it does here) you can safely "push DS, pop SS" and continue.
Another case which the expand down limit under DPMI causes problems
is with with -fomit-fp optimization.

Selector setup is an issue which different setups have different 
advantages.  We will probably have a flag for this in V2, but it hasn't been
done yet.

- Raw text -


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