Mail Archives: djgpp/1996/07/09/13:31:52
> What I want to know is: Is this programming practice bad? I assumed that
> a near pointer in protected mode was the same as a far, ie: could access the
> full 4GB segment. It also seems to allow fast memory access...
It's not bad, it just has some disadvantages you need to be aware of.
Since you can access the entire 4Gb area, a bad pointer can trash DOS,
disk data buffers, interrupt tables, etc. If you are running under Windows,
that means you can cause GPFs in other applications or trash windows itself.
Near pointers are also not supported on some DPMI providers (like Windows NT)
so your application will not run there.
It's a programming time vs safety/compatibility tradeoff. If you have little
time, don't make mistakes, and don't plan to support this app on systems
without near pointer support, near pointers are the perfect tool. If you
have a larger project with many programmers and modules, need to run it
many places, then you probably should design using farptr.h (at least as
an option + the first cut).
- Raw text -