This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
RE: Porting Boehm-gc to embedded m68k environment
- From: "Boehm, Hans" <hans_boehm at hp dot com>
- To: "'John Neil'" <jneil at atrove dot com>,"'Jeff Sturm'" <jsturm at one-point dot com>
- Cc: java at gcc dot gnu dot org
- Date: Wed, 12 Nov 2003 09:57:23 -0800
- Subject: RE: Porting Boehm-gc to embedded m68k environment
> From: java-owner@gcc.gnu.org [mailto:java-owner@gcc.gnu.org] On Behalf Of John Neil
> >>
> >> 1. The GC_alloc function(s) calls a clear stack function
> just prior to
> >> returning. I assume that this function is used to clear
> old addresses
> from
> >
> >It isn't necessary but is sometimes beneficial. Even if you know the
> >exact top of stack for each thread, portions of the stack within that
> >range are frequently uninitialized, so the GC takes the
> opportunity to
> >clear some of the stack when it can.
>
> The clearing only happens off the end of the stack, it does
> not affect the
> un-initialized values within the stack. In my case the stack
> is cleared
> when the thread is initialised so I can safely remove this
> stack clearing.
The code tries to clear the region of the stack between the current
stack pointer and the "high water mark" of the stack, i.e. the sp when
the stack was deepest. This section contains data written by prior,
now completed, function calls. Clearing the thread stack on initialization
probably helps a bit, but only for very short running threads. The
stack clearing in the collector is still useful, but probably not essential.
Hans