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

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

[dotgnu-pnet-commits] pnetlib ChangeLog resources/en_US/runtime/Arg.t...


From: Klaus Treichel
Subject: [dotgnu-pnet-commits] pnetlib ChangeLog resources/en_US/runtime/Arg.t...
Date: Sun, 17 Aug 2008 16:43:43 +0000

CVSROOT:        /cvsroot/dotgnu-pnet
Module name:    pnetlib
Changes by:     Klaus Treichel <ktreichel>      08/08/17 16:43:43

Modified files:
        .              : ChangeLog 
        resources/en_US/runtime: Arg.txt 
        runtime/System : ArgumentNullException.cs GC.cs 
Added files:
        runtime/System : GCCollectionMode.cs 

Log message:
        Add some 2.0 stuff for the garbage collector.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pnetlib/ChangeLog?cvsroot=dotgnu-pnet&r1=1.2538&r2=1.2539
http://cvs.savannah.gnu.org/viewcvs/pnetlib/resources/en_US/runtime/Arg.txt?cvsroot=dotgnu-pnet&r1=1.49&r2=1.50
http://cvs.savannah.gnu.org/viewcvs/pnetlib/runtime/System/ArgumentNullException.cs?cvsroot=dotgnu-pnet&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/pnetlib/runtime/System/GC.cs?cvsroot=dotgnu-pnet&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/pnetlib/runtime/System/GCCollectionMode.cs?cvsroot=dotgnu-pnet&rev=1.1

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/ChangeLog,v
retrieving revision 1.2538
retrieving revision 1.2539
diff -u -b -r1.2538 -r1.2539
--- ChangeLog   12 Aug 2008 18:21:21 -0000      1.2538
+++ ChangeLog   17 Aug 2008 16:43:42 -0000      1.2539
@@ -1,3 +1,17 @@
+2008-08-17  Klaus Treichel  <address@hidden>
+
+       * resources/en_US/runtime/Arg.txt: Add Arg_NotNullName=Argument.
+
+       * runtime/System/ArgumentNullException.cs: Add text for a named 
argument.
+
+       * runtime/System/GC.cs: Add Internal to the names of the internal calls.
+       (CollectionCount): Add Framework 2.0 method plus the corresponding
+       internal call.
+       (Collect): Add non ECMA Framework 2.0 versions with different arguments.
+
+       * runtime/System/GCCollectionMode.cs: Add new non ECMA Framework 2.0
+       enumeration.
+
 2008-08-12  Klaus Treichel  <address@hidden>
 
        * runtime/System/AppDomain.c, runtime/System/AppDomain.c: Replace the

Index: resources/en_US/runtime/Arg.txt
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/resources/en_US/runtime/Arg.txt,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -b -r1.49 -r1.50
--- resources/en_US/runtime/Arg.txt     22 Jul 2004 02:17:31 -0000      1.49
+++ resources/en_US/runtime/Arg.txt     17 Aug 2008 16:43:42 -0000      1.50
@@ -45,6 +45,7 @@
 Arg_InvalidHexStyle=Invalid hexadecimal number style
 Arg_DecBitCtor=Invalid bit array supplied to Decimal constructor
 Arg_NotNull=Argument cannot be null
+Arg_NotNullName=Argument {0} cannot be null
 Arg_OutOfRange=Argument is out of range
 Arg_OutOfRangeValue=Argument value: {0}
 Arg_DateTimeRange=DateTime value is out of range

Index: runtime/System/ArgumentNullException.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/ArgumentNullException.cs,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- runtime/System/ArgumentNullException.cs     26 May 2003 04:41:21 -0000      
1.7
+++ runtime/System/ArgumentNullException.cs     17 Aug 2008 16:43:42 -0000      
1.8
@@ -28,12 +28,13 @@
 {
        // Standard error message for null exceptions.
        private static String preloadedMessage = _("Arg_NotNull");
+       private static String preloadedNameMessage = _("Arg_NotNullName");
 
        // Constructors.
        public ArgumentNullException()
                : base(preloadedMessage) {}
        public ArgumentNullException(String paramName)
-               : base(preloadedMessage, paramName) {}
+               : base(preloadedNameMessage, paramName) {}
        public ArgumentNullException(String paramName, String msg)
                : base(msg, paramName) {}
 #if CONFIG_SERIALIZATION

Index: runtime/System/GC.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/GC.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- runtime/System/GC.cs        13 Jul 2006 13:12:33 -0000      1.5
+++ runtime/System/GC.cs        17 Aug 2008 16:43:42 -0000      1.6
@@ -1,8 +1,7 @@
-//#define CHECK_FINALIZERS
 /*
  * GC.cs - Implementation of the "System.GC" class.
  *
- * Copyright (C) 2001, 2002  Southern Storm Software, Pty Ltd.
+ * Copyright (C) 2001, 2002, 2008  Southern Storm Software, Pty Ltd.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -30,54 +29,83 @@
        // This class cannot be instantiated.
        private GC() {}
 
-       // Keep an object reference alive.
+       // Perform a full garbage collection.
+       [MethodImpl(MethodImplOptions.InternalCall)]
+       extern private static void CollectInternal(int collectionMode);
+
+#if !ECMA_COMPAT
+
+#if CONFIG_FRAMEWORK_2_0
+
+       // Get the total number of collections done.
+       [MethodImpl(MethodImplOptions.InternalCall)]
+       extern private static int CollectionCountInternal();
+
+#endif // CONFIG_FRAMEWORK_2_0
+
+       // Get the total amount of memory in use by the heap.
        [MethodImpl(MethodImplOptions.InternalCall)]
-       extern public static void KeepAlive(Object obj);
+       extern private static long GetTotalMemoryInternal(bool 
forceFullCollection);
+
+#endif // !ECMA_COMPAT
 
        // Re-register an object for finalization.
        [MethodImpl(MethodImplOptions.InternalCall)]
-       extern public static void ReRegisterForFinalize(Object obj);
+       extern private static void ReRegisterForFinalizeInternal(Object obj);
 
        // Suppress finalization for an object.
-#if CHECK_FINALIZERS
-       public static void SuppressFinalize(Object obj) {
-       }
-#else
        [MethodImpl(MethodImplOptions.InternalCall)]
-       extern public static void SuppressFinalize(Object obj);
-#endif
+       extern private static void SuppressFinalizeInternal(Object obj);
 
        // Wait for all pending finalizers to be run.
        [MethodImpl(MethodImplOptions.InternalCall)]
-       extern public static void WaitForPendingFinalizers();
+       extern private static void WaitForPendingFinalizersInternal();
+
+       // Perform a full garbage collection.
+       public static void Collect()
+                       {
+                               CollectInternal(0);
+                       }
 
 #if !ECMA_COMPAT
 
-       // Get the maximum generation currently in use.
-       public static int MaxGeneration
+       // Perform garbage collection on a range of generations.
+       public static void Collect(int generation)
                        {
-                               get
+                               if(generation != 0)
                                {
-                                       // We don't currently support 
generational collection.
-                                       return 0;
+                                       throw new ArgumentOutOfRangeException
+                                               ("generation", 
_("ArgRange_GCGeneration"));
                                }
+                               CollectInternal(0);
                        }
 
-       // Perform a full garbage collection.
-       [MethodImpl(MethodImplOptions.InternalCall)]
-       extern public static void Collect();
+#if CONFIG_FRAMEWORK_2_0
 
-       // Perform garbage collection on a range of generations.
-       public static void Collect(int generation)
+       // Perform garbage collection on a range of generations with the given
+       // collection mode
+       public static void Collect(int generation, GCCollectionMode mode)
                        {
                                if(generation != 0)
                                {
                                        throw new ArgumentOutOfRangeException
                                                ("generation", 
_("ArgRange_GCGeneration"));
                                }
-                               Collect();
+                               CollectInternal(0);
                        }
 
+       public static int CollectionCount(int generation)
+                       {
+                               if(generation != 0)
+                               {
+                                       throw new ArgumentOutOfRangeException
+                                               ("generation", 
_("ArgRange_GCGeneration"));
+                               }
+                               return CollectionCountInternal();
+                       }
+
+#endif // CONFIG_FRAMEWORK_2_0
+
        // Get the generation of a specified object.
        public static int GetGeneration(Object obj)
                        {
@@ -98,11 +126,60 @@
                        }
 
        // Get the total amount of memory in use by the heap.
-       [MethodImpl(MethodImplOptions.InternalCall)]
-       extern public static long GetTotalMemory(bool forceFullCollection);
+       public static long GetTotalMemory(bool forceFullCollection)
+                       {
+                               return 
GetTotalMemoryInternal(forceFullCollection);
+                       }
+
+#endif // !ECMA_COMPAT
+
+       // Keep an object reference alive.
+       // This function does nothing but accessing obj and so preventing it
+       // from being collected.
+       // Calls to this function MUST NOT be optimized away.
+       public static void KeepAlive(Object obj)
+                       {
+                       }
+
+#if !ECMA_COMPAT
+
+       // Get the maximum generation currently in use.
+       public static int MaxGeneration
+                       {
+                               get
+                               {
+                                       // We don't currently support 
generational collection.
+                                       return 0;
+                               }
+                       }
 
 #endif // !ECMA_COMPAT
 
+       public static void ReRegisterForFinalize(Object obj)
+                       {
+                               if(obj == null)
+                               {
+                                       throw new ArgumentNullException("obj");
+                               }
+                               ReRegisterForFinalizeInternal(obj);
+                       }
+
+       // Suppress finalization for an object.
+       public static void SuppressFinalize(Object obj)
+                       {
+                               if(obj == null)
+                               {
+                                       throw new ArgumentNullException("obj");
+                               }
+                               SuppressFinalizeInternal(obj);
+                       }
+
+       // Wait for all pending finalizers to be run.
+       public static void WaitForPendingFinalizers()
+                       {
+                               WaitForPendingFinalizersInternal();
+                       }
+
 }; // class GC
 
 }; // namespace System

Index: runtime/System/GCCollectionMode.cs
===================================================================
RCS file: runtime/System/GCCollectionMode.cs
diff -N runtime/System/GCCollectionMode.cs
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ runtime/System/GCCollectionMode.cs  17 Aug 2008 16:43:42 -0000      1.1
@@ -0,0 +1,36 @@
+/*
+ * GCCollectionMode.cs - Implementation of "System.GCCollectionMode" class.
+ *
+ * Copyright (C) 2008  Southern Storm Software, Pty Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+namespace System
+{
+
+#if !ECMA_COMPAT && CONFIG_FRAMEWORK_2_0
+
+public enum GCCollectionMode
+{
+       Default         = 0,
+       Forced          = 1,
+       Optimized       = 2
+
+}; // enum GCCollectionMode
+
+#endif // !ECMA_COMPAT && CONFIG_FRAMEWORK_2_0
+
+}; // namespace System




reply via email to

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