Date: Mon, 10 Mar 1997 17:57:30 +0200 (IST) From: Eli Zaretskii To: Paul Derbyshire cc: djgpp AT delorie DOT com Subject: Re: __djgpp_base_address In-Reply-To: <5g0ao0$sjl@freenet-news.carleton.ca> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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.