Re: [cp-patches] FYI: Add Enum.finalize()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

FYI, JamVM does something similar.  All objects effectively have a
finalizer because java.lang.Object implements an empty finalizer, so
if a VM didn't do something, _all_ objects would need finalization.

JamVM therefore records a class as having a finalizer only if it has
overridden the one in java.lang.Object.  The assumption is that it
will only provide it's own finalizer if it actually has something to
do, so the code currently doesn't check if it is empty or not.  I will
add this check.

Rob.

On 12/21/06, Christian Thalinger <twisti@xxxxxxxxxxxxxxxxxxxxx> wrote:
On Wed, Dec 20, 2006 at 10:28:13AM +0100, Christian Thalinger wrote:
> On Wed, Dec 20, 2006 at 09:34:29AM +0100, Mark Wielaard wrote:
> > Interesting. Even though Enums should never be initialized "by hand"
> > this is something a garbage collector should be aware of. Do garbage
> > collectors already handle empty finalize() methods as if there was no
> > finalizer?
>
> In CACAO we currently search for a finalizer method and add it if one is
> found.  We don't check if there is actually code in it.

But we set the finalizer for java.lang.Object to NULL, which means we
actually don't have any finalizers in subclasses.  The case, where an
empty finalizer is given in a subclass, isn't handled yet.  I'll change
that.

- twisti




[Index of Archives]     [Linux Kernel]     [Linux Cryptography]     [Fedora]     [Fedora Directory]     [Red Hat Development]

  Powered by Linux