Mail Archives: djgpp-workers/1997/06/22/05:07:27
On Thu, 19 Jun 1997, Charles Sandmann wrote:
> Could be. Could be anything. If it's a function then you have the
> call overhead, but you can replace the function easily for personal
> preference without a library re-compile.
>
> > The only hastle I can see is the need to distribute multiple libraries
> > or answere a lot of question relating to code size/how to get debug code etc.
>
> I would not distribute multiple libraries.
An alternative to multiple libraries (which I don't like either) is to
have an environment variable which is used to turn on and off this
feature. For example:
set DJGPPNULLPTR=y
rem run with protection
set DJGPPNULLPTR=n
rem run without protection
Since this requires a call to `getenv', we could (for performance
reasons) add a single call to `getenv' in the startup code that will
set a variable, then make all the functions that test for null
pointers to access that variable. (This assumes that nobody would say
`putenv("DJGPPNULLPTR=y")' in the middle of a program and expect this
to take effect, although this might be a problem with shells compiled
with DJGPP.)
- Raw text -