Re: kaffe.util.Ptr

Date view Thread view Subject view Author view

From: Godmar Back (gback@cs.utah.edu)
Date: Mon Oct 19 1998 - 14:14:28 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?
>

 Oops, you're right, it should be marked, but not walked.

Now I think simply using java.lang.Object (as opposed to kaffe.util.Ptr), but
allocating the non-"object" with GC_NOWALK should do the trick. I don't
think we need to do anything special here because everything that's on the
grey list will go through walkMemory anyway.
 
 Basically, the mark phase will think it's an object, put it on the grey list,
schedule it for walking, but the actual walking won't do anything.

        - Godmar


Date view Thread view Subject view Author view

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