[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] Default Stack Size
Vincent Rivière wrote:
Standa Opichal wrote:
Therefore the only viable solution is to build dynamically expanding
stack capabilities into the kernel.
A dynamically expanding stack cannot be implemented without Virtual
Memory. So as long as Virtual Memory is not available in the FreeMiNT
kernel, the only solution is to use a fixed stack size for each process,
which is inherently insane as you have demonstrated.
A large portion of the stack problems with unix programs is
caused by the alloca function.
Maybe the easiest way is redesign alloca such that it allocates from
the GEMDOS heap and only keeps pointers on the stack.
This also means that you need some help from GCC at function end.
I would invite you to have a look at AHCM on my website (in sig)
AHCM provides a solution that should be easy to implement
in a compiler assisted manner.
The most important aspect of AHCM is the removal of the need of
knowing the pointer to the block to be freed. In stead, versions of
malloc and free_all have been designed that use keys.
The stack based allocation system using the heap is performed
by the functions XA_up, XA_new and XA_down.
Henk Robbers. http://members.chello.nl/h.robbers
Interactive disassembler: TT-Digger; http://digger.atari.org
A Home Cooked C compiler: AHCC