Mail Archives: djgpp/1997/03/08/20:59:26
Matthew Kennedy writes:
>I've got a sophisticated 'real-time' program (with lots of ISR hooking
>etc) and I'd like to lock the ENTIRE program (code,data - everthing) out
>of virtual memory disk swaps. How can I perform this? Currently I only
>lock out the code/data that is critical - but I can't lock out the other
>libraries like standard I/O.
Somewhere in your program, add a global variable:
#include <crt0.h>
int _crt0_startup_flags = _CRT0_FLAG_NONMOVE_SBRK |
_CRT0_FLAG_LOCK_MEMORY;
Look in crt0.h for details about this: there are a lot of other handy
flags that you can set in this way, to control the behaviour of the
startup code and library routines.
Whether locking the entire program is a good move, though, I tend to
doubt. It isn't a very polite way to behave, if it is going to be run
under a multitasking OS :-)
/*
* Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
* Beauty is a French phonetic corruption of a short cloth neck ornament.
*/
- Raw text -