I would agree with Steve here except that ECMA 335 discusses this as well.

8.9.6.7 Finalizers
A class definition that creates an object type can supply an instance
method (called a finalizer) to be called
when an instance of the class is no longer reachable. The class
System.GC (see Partition IV) provides limited
control over the behavior of finalizers through the methods
SuppressFinalize and ReRegisterForFinalize.
Conforming implementations of the CLI can specify and provide
additional mechanisms that affect the
behavior of finalizers.

The mechanism for Finalizers is discussed in ...

10.5.2 Instance finalizer
The behavior of finalizers is specified in Partition I. The finalize
method for a particular type is specified by
overriding the virtual method Finalize in System.Object.


As such a compliant CLR could run finalizers (even when they are
empty) and it would in fact run a finalizer on every object (excluding
unboxed value types of course). It is an *implementational detail*
that the MS production CLR in its current state has an optimization to
recognize that the finalizer does nothing and therefore does not run
it.

Cheers,

Greg



On 9/6/07, Steve Johnson <[EMAIL PROTECTED]> wrote:
> On 9/6/07, Erik M. Erikson <[EMAIL PROTECTED]> wrote:
> >
> > Section 10.12 of the version 1.2 of the C# language clearly supports
> > Russell within that scope.
> >
>
> I would disagree.  However, even if it does, we're not discussing the C#
> language spec.  We're talking about MS CLR Finalizers.  There is a big
> difference.  The C# language need not be implemented on top of the MS CLR.
> The CLR does not call Object.Finalize...it only calls Finalize on instances
> of classes that have a Finalize override further up the heirarchy.
>
> --
> Steve Johnson
>
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com
>
> View archives and manage your subscription(s) at http://discuss.develop.com
>


--
Studying for the Turing test

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to