delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/10/11:15:48

Date: Mon, 10 Mar 1997 17:57:30 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Paul Derbyshire <ao950 AT FreeNet DOT Carleton DOT CA>
cc: djgpp AT delorie DOT com
Subject: Re: __djgpp_base_address
In-Reply-To: <5g0ao0$sjl@freenet-news.carleton.ca>
Message-ID: <Pine.SUN.3.91.970310175301.29057M-100000@is>
MIME-Version: 1.0

On 10 Mar 1997, Paul Derbyshire wrote:

> * This seems to say that something like this won't work:
> 
>   char *the_ptr;
>   the_ptr=malloc(the_size);
>   _go32_lock_data_memory(the_ptr,size); (syntax? not sure)
> 
>   because later the data may find itself moved somewhere (despite being
>   locked?) while the locked memory stays put?

The data won't move, but the base address of the DS selector can change.  
Keep in mind that in 32-bit flat-address mode, all addresses are just 
offsets from the base address specified by the selector loaded in DS (or 
in CS, or in SS, if you are talking about code or stack, respectively).  
If a program uses tricks like `nearptr' to access all available memory, 
it could crash and burn if it assumes the sum of base address + offset 
stays put.

- Raw text -


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