Mail Archives: djgpp/1997/03/10/11:15:48
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 -