Re: kaffe.util.Ptr

Date view Thread view Subject view Author view

From: Tim Wilkinson (tim@transvirtual.com)
Date: Mon Oct 19 1998 - 14:01:18 EDT


The thing about backtrace is that it *must* be part of the GC (which is why
it's an object). If you look at the way its allocated the data isn't a Java
object (just a C array) but it is allocated from the GCed heap - if you turn
this reference into a kaffe.util.Ptr then it'll never get marked and so will
get free unexpectedly.

There are a few of options to fix this I guess - (1) use gc_malloc_fixed to
allocate the backtrace and add a finalizer to tidy up, (2) create a new
kaffe.util.MarkPtr class which is a reference to GCed stuff which doesn't
conform to the standard Object model, or (3) allocate the backtrace in a Java
byte array.

Thoughts?

Tim

Godmar Back wrote:

> >
> > I can confirm that all memory references which are *not* part of the GC
> > should be referenced using kaffe.util.Ptr - I take it that there are
> > references which break this rule?
> >
>
> The only one that I know is breaking the rule is the backtrace
> in java.lang.Throwable; I've changed that already.
>
> My question was more along the lines of whether you know of other examples
> where this rule has been broken.
>
> - Godmar

--
  Tim Wilkinson                         Tel:     +1 510 704 1660
  Transvirtual Technologies, Inc.,      Fax:     +1 510 704 1893
  Berkeley, CA, USA.                    Email:   tim@transvirtual.com


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:57:00 EDT