dotgnu-pnet-commits
[Top][All Lists]
Advanced

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

[Dotgnu-pnet-commits] CVS: pnet/engine lib_gc.c,1.4,1.5


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/engine lib_gc.c,1.4,1.5
Date: Wed, 06 Nov 2002 17:48:59 -0500

Update of /cvsroot/dotgnu-pnet/pnet/engine
In directory subversions:/tmp/cvs-serv9451/engine

Modified Files:
        lib_gc.c 
Log Message:


Remove all class checks from GC.SuppressFinalize and GC.ReRegisterForFinalize,
to be consistent with other CLR implementations.


Index: lib_gc.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/lib_gc.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** lib_gc.c    6 Nov 2002 20:24:22 -0000       1.4
--- lib_gc.c    6 Nov 2002 22:48:56 -0000       1.5
***************
*** 45,66 ****
        if(obj)
        {
!               /* We can only register finalization if the current method
!                  has the same class as the object itself */
!               ILMethod *method = ILExecThreadStackMethod(_thread, 1);
!               if(method && ILMethod_Owner(method) == GetObjectClass(obj))
                {
!                       if(((ILClassPrivate *)((GetObjectClass(obj))->userData))
!                                       ->hasFinalizer)
!                       {
!                               ILGCRegisterFinalizer
!                                       ((void *)(((unsigned char *)obj) - 
IL_BEST_ALIGNMENT),
!                                        _ILFinalizeObject, (void *)0);
!                       }
!               }
!               else
!               {
!                       ILExecThreadThrowSystem
!                               (_thread, "System.ExecutionEngineException",
!                                (const char *)0);
                }
        }
--- 45,54 ----
        if(obj)
        {
!               if(((ILClassPrivate *)((GetObjectClass(obj))->userData))
!                               ->hasFinalizer)
                {
!                       ILGCRegisterFinalizer
!                               ((void *)(((unsigned char *)obj) - 
IL_BEST_ALIGNMENT),
!                                _ILFinalizeObject, (void *)0);
                }
        }
***************
*** 78,97 ****
        if(obj)
        {
!               /* We can only suppress finalization if the current method
!                  has the same class as the object itself */
!               ILMethod *method = ILExecThreadStackMethod(_thread, 1);
!               if(method && ILClassInheritsFrom(GetObjectClass(obj),
!                                                               
ILMethod_Owner(method)))
!               {
!                       ILGCRegisterFinalizer
!                               ((void *)(((unsigned char *)obj) - 
IL_BEST_ALIGNMENT),
!                                (ILGCFinalizer)0, (void *)0);
!               }
!               else
!               {
!                       ILExecThreadThrowSystem
!                               (_thread, "System.InvalidOperationException",
!                                (const char *)0);
!               }
        }
        else
--- 66,72 ----
        if(obj)
        {
!               ILGCRegisterFinalizer
!                       ((void *)(((unsigned char *)obj) - IL_BEST_ALIGNMENT),
!                        (ILGCFinalizer)0, (void *)0);
        }
        else





reply via email to

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