From mint-bounce@lists.fishpool.fi Thu Feb 19 08:57:28 2009 X-SourceIP: 77.251.205.20 Message-ID: <499D5A11.9010301@chello.nl> Date: Thu, 19 Feb 2009 14:09:37 +0100 From: Henk Robbers User-Agent: Mozilla Thunderbird 1.0.2 (Macintosh/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: MiNT Mailing List Subject: Re: [MiNT] Default Stack Size References: <499C82B4.6060005@atari-source.org> <499C944D.7090404@freesbee.fr> <499C966D.4020204@atari-source.org> <499D3373.4090308@freesbee.fr> In-Reply-To: <499D3373.4090308@freesbee.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-to: mint-bounce@lists.fishpool.fi X-original-sender: h.robbers@chello.nl Precedence: bulk List-help: List-unsubscribe: List-Id: X-List-ID: List-subscribe: List-owner: List-post: 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. -- Groeten; Regards. Henk Robbers. http://members.chello.nl/h.robbers Interactive disassembler: TT-Digger; http://digger.atari.org A Home Cooked C compiler: AHCC