classpath
[Top][All Lists]
Advanced

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

Re: More finalize woes


From: Per Bothner
Subject: Re: More finalize woes
Date: Thu, 06 Mar 2003 17:06:36 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20030210

Stephen Crawley wrote:
I'd say yes.  A compiler cannot know what the target VM's implementation of
java.lang.Object.finalize() does, and hence whether calling it is necessary.

It can know that any *correct* implementation of Object.finalize is
a no-op, so there is no reason it call it.  It is hard to imagine any
use for a non-empty Object.finalize; any VM-specific actions on
object cleanup should be part of the run-time system instead.

An unnecessary call to java.lang.Object.finalize() won't hurt anyone.

Well, there is always performance ...

Besides, this would only be a compiler warning, and the user would be
free to ignore it.

Many projects, including gcc itself, prohibit warnings.
--
        --Per Bothner
address@hidden   http://www.bothner.com/per/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]