Newsgroups: comp.sys.amiga.programmer
Path: utzoo!utgpu!watserv1!maytag!maytag!himacdon
From: himacdon@maytag.uwaterloo.ca (Hamish Macdonald)
Subject: Re: AmigaGCC stack hogging
In-Reply-To: swalton@solaria.csun.edu's message of 14 Jan 91 21:22:54 GMT
Message-ID: <1991Jan15.154204.10833@maytag.waterloo.edu>
Sender: daemon@maytag.waterloo.edu (Admin)
Organization: University of Waterloo, Waterloo, Ontario
References: <1882f287.ARN1979@moria.UUCP> <1991Jan14.212254.9779@csun.edu>
Date: Tue, 15 Jan 91 15:42:04 GMT
Lines: 41

>>>>> In article <1991Jan14.212254.9779@csun.edu>,
>>>>> swalton@solaria.csun.edu (Stephen Walton) writes:

Stephen> In article <1882f287.ARN1979@moria.UUCP>, bojsen@moria (Per Bojsen) writes:

>What is the precise reason for the large stack needs of GCC?

Stephen> This is not peculiar to GCC.  All of the GNU software is
Stephen> written as if the amount of available stack was essentially
Stephen> infinite.  The GNU regular expression routines, for instance,
Stephen> use alloca() extensively.

This is, of course, becuase all of the GNU software is written with
Unices in mind, which provide virtual memory, and allow the stack to
grow to be as big as it wants (in general).  I'd say this is perfectly
reasonable.

Stephen> You will also find that GNU Emacs crashes on an A3000 running
Stephen> AmigaOS, because it uses the high bits of a 32 bit address to
Stephen> store information about Emacs Lisp objects.  About the only
Stephen> other Amiga software which does this is AmigaBasic!

This isn't really the problem, since Emacs masks off the type and GC
bits before doing any address indirection.

The problem is that Emacs relies on address mapping hardware giving it an
address space consisting of the memory from 0-16M.   Usually, 16M _is_
enough for an editor.  Unfortunately, on the A3000, most of the memory
is _not_ in this 16M address space, so there are problems (actually,
you can extend the address space to 64M; I believe the person who
ported Gnu Emacs to the Amiga did this to support the A3000).

The Emacs Lisp implementation does need to be changed to support full
32 bit object addresses, both to solve the problem on the Amiga, and
also to allow Emacs processes to grow larger than 16M (although it is
currently possible.

Hamish.
--
--------------------------------------------------------------------
himacdon@maytag.uwaterloo.ca                 watmath!maytag!himacdon
