Mail Archives: djgpp/1997/03/05/03:56:30
On Tue, 4 Mar 1997, Scott Fleischman wrote:
> Thank you for your reply but I diagree with never using __djgpp_base_address,
> and in this case it is the right thing to use.
Well, in your case, I fail to understand what on earth are you trying
to achieve, so I can't judge whether you indeed need
`__djgpp_base_address'. If you need to lock the memory of the entire
program, then that's NOT how it should be done. The correct way is
just to set the `_CRT0_FLAG_LOCK_MEMORY' bit in the
`_crt0_startup_flags' variable, as the FAQ explains (section 18.9).
The way you did it, you only lock static data and code, but not the
memory allocated by the calls to `malloc' and friends, and neither the
stack.
`__djgpp_conventional_base' and the nearptr feature are for fast
access to memory-mapped devices and absolute addresses, they are not
the proper tools for locking memory, AFAIK.
> If I use __djgpp_conventional_base it doesn't work.
The fact that it doesn't work isn't in itself a proof that it isn't
the right thing to do; the rest of your code might be the reason for
that.
- Raw text -