From: Archie Cobbs (archie@whistle.com)
Date: Mon Oct 19 1998 - 14:11:11 EDT
Tim Wilkinson writes:
> 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.
Ugh.. more special hidden stuff for developers to remember regarding
kaffe.util.Ptr: ie, don't allocate using the normal GC malloc()..
> 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.
I vote for #3 of course :-) Then no special hackery is involved -> simpler.
-Archie
___________________________________________________________________________
Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com
This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:57:00 EDT