Mail Archives: djgpp/1997/06/07/20:03:31
POULAIN Vincent wrote:
>
> I'm not a DJGPP expert, so I don't know if ways to not to go under
> protected mode
> exists.
They do not. In order to run the CPU in 32-bit mode, DJGPP programs
must enter protected mode.
> You'll certainly be amazed when you'll see that a swp disk will be
> automatically created too
> if you run out of memory !
>
> About this (this is a question this time), do these swaps happen when the
> physical
> RAM is over, or when the stack is overflowed ?
> I hope it's the second solution, otherwise, my actual project needs some
> optimizing !
All available physical and virtual memory is pooled into one huge block
of memory that your programs can draw from. When you use more memory
than is physically available, some physical memory will be swapped to
disk; this is called virtual memory. The stack space is finite and is
determined when your program is compiled. The default is 256K; if you
write a program that uses large automatic variables or deeply recursive
functions, you may want to increase the size of the stack. To increase
the stack, do one of the following:
In your program:
int _stklen = /* size of stack in bytes */;
After compilation, run 'stubedit' on your program:
stubedit program.exe -minstack=1024k
Remember that the stack is drawn from the same memory pool as the rest
of your program's data, so making it too large may reduce the amount of
data you can store on low memory machines.
--
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I | mailto:fighteer AT cs DOT com |
| God's final message to His Creation: | http://www.cs.com/fighteer |
| "We apologize for the inconvenience."| <<< This tagline under >>> |
| - Douglas Adams | <<< construction >>> |
---------------------------------------------------------------------
- Raw text -