From: John Doe Date: Mon, 18 Jun 2018 17:45:13 +0000 (-0700) Subject: Typo (dotnet/coreclr#18520) X-Git-Tag: submit/tizen/20210909.063632~11030^2~4580 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bdd95622ee59296b595132964d2fae17594a9ed8;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Typo (dotnet/coreclr#18520) * Acutal -> Actual * addtional -> additional * agressive -> aggressive * agument -> argument * Alignement -> Alignment * alredy -> already * MAnaged -> Managed * analagous -> analogous * aquire -> acquire * arbitary -> arbitrary Commit migrated from https://github.com/dotnet/coreclr/commit/22bfefbc787629d9d5637cd37fc92701b95dcea0 --- diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.cs index a1cee10..69ac49f 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -// +// using System; using System.Diagnostics.SymbolStore; @@ -991,7 +991,7 @@ namespace System.Reflection.Emit this.Emit(OpCodes.Endfinally); } - //Check if we've alredy set this label. + //Check if we've already set this label. //The only reason why we might have set this is if we have a finally block. if (m_labelList[endLabel.GetLabelValue()] == -1) { @@ -1092,7 +1092,7 @@ namespace System.Reflection.Emit Label finallyEndLabel = this.DefineLabel(); current.SetFinallyEndLabel(finallyEndLabel); - // generate leave for try clause + // generate leave for try clause this.Emit(OpCodes.Leave, finallyEndLabel); if (catchEndAddr == 0) catchEndAddr = m_length; @@ -1576,7 +1576,7 @@ namespace System.Reflection.Emit // WARNING: This is not a generic function to determine the innerness // of an exception. This is somewhat of a mis-nomer. This gives a // random result for cases where the two exceptions being compared do - // not having a nesting relation. + // not having a nesting relation. internal bool IsInner(__ExceptionInfo exc) { Debug.Assert(exc != null); @@ -1824,7 +1824,7 @@ namespace System.Reflection.Emit } } - // cannot find an existing document so add one to the array + // cannot find an existing document so add one to the array EnsureCapacity(); m_iLastFound = m_DocumentCount; m_Documents[m_iLastFound] = new REDocument(document); diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilder.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilder.cs index 01deec7..ee7efbb 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilder.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilder.cs @@ -3,7 +3,7 @@ // See the LICENSE file in the project root for more information. -// +// namespace System.Reflection.Emit { @@ -74,11 +74,11 @@ namespace System.Reflection.Emit if (!(type is TypeBuilder) && !(type is TypeBuilderInstantiation)) throw new ArgumentException(SR.Argument_MustBeTypeBuilder); - // The following checks establishes invariants that more simply put require type to be generic and + // The following checks establishes invariants that more simply put require type to be generic and // method to be a generic method definition declared on the generic type definition of type. - // To create generic method G.M these invariants require that G.M be created by calling + // To create generic method G.M these invariants require that G.M be created by calling // this function followed by MakeGenericMethod on the resulting MethodInfo to finally get G.M. - // We could also allow G.M to be created before G.M (BindGenParm followed by this method) + // We could also allow G.M to be created before G.M (BindGenParm followed by this method) // if we wanted to but that just complicates things so these checks are designed to prevent that scenario. if (method.IsGenericMethod && !method.IsGenericMethodDefinition) @@ -91,7 +91,7 @@ namespace System.Reflection.Emit throw new ArgumentException(SR.Argument_InvalidMethodDeclaringType, nameof(type)); // The following converts from Type or TypeBuilder of G to TypeBuilderInstantiation G. These types - // both logically represent the same thing. The runtime displays a similar convention by having + // both logically represent the same thing. The runtime displays a similar convention by having // G.M() be encoded by a typeSpec whose parent is the typeDef for G and whose instantiation is also G. if (type.IsGenericTypeDefinition) type = type.MakeGenericType(type.GetGenericArguments()); @@ -263,11 +263,11 @@ namespace System.Reflection.Emit runtimeType2 = t2; } - // If the type builder view is eqaul then it is equal + // If the type builder view is eqaul then it is equal if (tb1 != null && tb2 != null && Object.ReferenceEquals(tb1, tb2)) return true; - // if the runtimetype view is eqaul than it is equal + // if the runtimetype view is eqaul than it is equal if (runtimeType1 != null && runtimeType2 != null && runtimeType1 == runtimeType2) return true; @@ -1016,7 +1016,7 @@ namespace System.Reflection.Emit return m_bakedRuntimeType.IsAssignableFrom(fromRuntimeType); } - // So if c is not a runtimeType nor TypeBuilder. We don't know how to deal with it. + // So if c is not a runtimeType nor TypeBuilder. We don't know how to deal with it. // return false then. if (fromTypeBuilder == null) return false; @@ -1926,7 +1926,7 @@ namespace System.Reflection.Emit if (meth.IsGenericMethodDefinition) - meth.GetToken(); // Doubles as "CreateMethod" for MethodBuilder -- analagous to CreateType() + meth.GetToken(); // Doubles as "CreateMethod" for MethodBuilder -- analogous to CreateType() methodAttrs = meth.Attributes; diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RtFieldInfo.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RtFieldInfo.cs index 0ebed6e..e5032be 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RtFieldInfo.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RtFieldInfo.cs @@ -13,7 +13,7 @@ namespace System.Reflection internal unsafe sealed class RtFieldInfo : RuntimeFieldInfo, IRuntimeFieldInfo { #region Private Data Members - // agressive caching + // aggressive caching private IntPtr m_fieldHandle; private FieldAttributes m_fieldAttributes; // lazy caching @@ -43,7 +43,7 @@ namespace System.Reflection } // If the invocationFlags are still 0, then - // this should be an usable field, determine the other flags + // this should be an usable field, determine the other flags if (invocationFlags == 0) { if ((m_fieldAttributes & FieldAttributes.InitOnly) != (FieldAttributes)0) @@ -159,8 +159,8 @@ namespace System.Reflection // UnsafeSetValue doesn't perform any consistency or visibility check. // It is the caller's responsibility to ensure the operation is safe. // When the caller needs to perform visibility checks they should call - // InternalSetValue() instead. When the caller needs to perform - // consistency checks they should call CheckConsistency() before + // InternalSetValue() instead. When the caller needs to perform + // consistency checks they should call CheckConsistency() before // calling this method. [DebuggerStepThroughAttribute] [Diagnostics.DebuggerHidden] @@ -209,8 +209,8 @@ namespace System.Reflection // UnsafeGetValue doesn't perform any consistency or visibility check. // It is the caller's responsibility to ensure the operation is safe. // When the caller needs to perform visibility checks they should call - // InternalGetValue() instead. When the caller needs to perform - // consistency checks they should call CheckConsistency() before + // InternalGetValue() instead. When the caller needs to perform + // consistency checks they should call CheckConsistency() before // calling this method. [DebuggerStepThroughAttribute] [Diagnostics.DebuggerHidden] @@ -268,7 +268,7 @@ namespace System.Reflection #endregion - #region FieldInfo Overrides + #region FieldInfo Overrides public override Object GetValue(Object obj) { StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIReferenceImpl.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIReferenceImpl.cs index 9e1a9f3..04150db 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIReferenceImpl.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIReferenceImpl.cs @@ -105,7 +105,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime } // - // IList & ICollection methods. + // IList & ICollection methods. // This enables two-way data binding and index access in Jupiter // Object IList.this[int index] @@ -393,7 +393,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime } else { - // All WinRT reference type (including arbitary managed type) will be PropertyType.ObjectArray + // All WinRT reference type (including arbitrary managed type) will be PropertyType.ObjectArray return new CLRIReferenceArrayImpl(PropertyType.InspectableArray, (Object[])obj); } } diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMarshal.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMarshal.cs index e0633c0..521ad9d 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMarshal.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMarshal.cs @@ -133,7 +133,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime } // Push a new token into this list - // Returns true if you need to copy back this list into the dictionary (so that you + // Returns true if you need to copy back this list into the dictionary (so that you // don't lose change outside the dictionary). false otherwise. public bool Push(EventRegistrationToken token) { @@ -186,25 +186,25 @@ namespace System.Runtime.InteropServices.WindowsRuntime // // The full structure of this table is: // object the event is being registered on -> - // Table [RemoveMethod] -> + // Table [RemoveMethod] -> // Table [Handler] -> Token // // Note: There are a couple of optimizations I didn't do here because they don't make sense for managed events: // 1. Flatten the event cache (see EventCacheKey in native WinRT event implementation below) // - // This is because managed events use ConditionalWeakTable to hold Objects->(Event->(Handler->Tokens)), - // and when object goes away everything else will be nicely cleaned up. If I flatten it like native WinRT events, - // I'll have to use Dictionary (as ConditionalWeakTable won't work - nobody will hold the new key alive anymore) - // instead, and that means I'll have to add more code from native WinRT events into managed WinRT event to support - // self-cleanup in the finalization, as well as reader/writer lock to protect against race conditions in the finalization, + // This is because managed events use ConditionalWeakTable to hold Objects->(Event->(Handler->Tokens)), + // and when object goes away everything else will be nicely cleaned up. If I flatten it like native WinRT events, + // I'll have to use Dictionary (as ConditionalWeakTable won't work - nobody will hold the new key alive anymore) + // instead, and that means I'll have to add more code from native WinRT events into managed WinRT event to support + // self-cleanup in the finalization, as well as reader/writer lock to protect against race conditions in the finalization, // which adds a lot more complexity and doesn't really worth it. - // - // 2. Use conditionalWeakTable to hold Handler->Tokens. - // - // The reason is very simple - managed object use dictionary (see EventRegistrationTokenTable) to hold delegates alive. - // If the delegates aren't alive, it means either they have been unsubscribed, or the object itself is gone, + // + // 2. Use conditionalWeakTable to hold Handler->Tokens. + // + // The reason is very simple - managed object use dictionary (see EventRegistrationTokenTable) to hold delegates alive. + // If the delegates aren't alive, it means either they have been unsubscribed, or the object itself is gone, // and in either case, they've been already taken care of. - // + // internal volatile static ConditionalWeakTable>> s_eventRegistrations = new ConditionalWeakTable>>(); @@ -290,12 +290,12 @@ namespace System.Runtime.InteropServices.WindowsRuntime // Select a registration token to unregister // We don't care which one but I'm returning the last registered token to be consistent - // with native event registration implementation + // with native event registration implementation bool moreItems = tokens.Pop(out token); if (!moreItems) { // Remove it from cache if this list become empty - // This must be done because EventRegistrationTokenList now becomes invalid + // This must be done because EventRegistrationTokenList now becomes invalid // (mostly because there is no safe default value for EventRegistrationToken to express 'no token') // NOTE: We should try to remove registrationTokens itself from cache if it is empty, otherwise // we could run into a race condition where one thread removes it from cache and another thread adds @@ -374,11 +374,11 @@ namespace System.Runtime.InteropServices.WindowsRuntime // // EventRegistrationTokenListWithCount - // + // // A list of EventRegistrationTokens that maintains a count // // The reason this needs to be a separate class is that we need a finalizer for this class - // If the delegate is collected, it will take this list away with it (due to dependent handles), + // If the delegate is collected, it will take this list away with it (due to dependent handles), // and we need to remove the PerInstancEntry from cache // See ~EventRegistrationTokenListWithCount for more details // @@ -495,7 +495,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime // // The full structure of this table is: // EventCacheKey (instanceKey, eventMethod) -> EventCacheEntry (Handler->tokens) - // + // // A InstanceKey is the IUnknown * or static type instance // // Couple of things to note: @@ -503,12 +503,12 @@ namespace System.Runtime.InteropServices.WindowsRuntime // based on the same COM object. For example: // m_canvas.GetAt(0).Event += Func; // m_canvas.GetAt(0).Event -= Func; // GetAt(0) might create a new RCW - // + // // 2. Handler->Token is a ConditionalWeakTable because we don't want to keep the delegate alive - // and we want EventRegistrationTokenListWithCount to be finalized after the delegate is no longer alive + // and we want EventRegistrationTokenListWithCount to be finalized after the delegate is no longer alive // 3. It is possible another COM object is created at the same address - // before the entry in cache is destroyed. More specifically, - // a. The same delegate is being unsubscribed. In this case we'll give them a + // before the entry in cache is destroyed. More specifically, + // a. The same delegate is being unsubscribed. In this case we'll give them a // stale token - unlikely to be a problem // b. The same delegate is subscribed then unsubscribed. We need to make sure give // them the latest token in this case. This is guaranteed by always giving the last token and always use equality to @@ -553,7 +553,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime object instanceKey = GetInstanceKey(removeMethod); // Call addMethod outside of RW lock - // At this point we don't need to worry about race conditions and we can avoid deadlocks + // At this point we don't need to worry about race conditions and we can avoid deadlocks // if addMethod waits on finalizer thread // If we later throw we need to remove the method EventRegistrationToken token = addMethod(handler); @@ -579,7 +579,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime // // We need to find the key that equals to this handler // Suppose we have 3 handlers A, B, C that are equal (refer to the same object and method), - // the first handler (let's say A) will be used as the key and holds all the tokens. + // the first handler (let's say A) will be used as the key and holds all the tokens. // We don't need to hold onto B and C, because the COM object itself will keep them alive, // and they won't die anyway unless the COM object dies or they get unsubscribed. // It may appear that it is fine to hold A, B, C, and add them and their corresponding tokens @@ -711,7 +711,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime // (but with the same object/method), so we need to find the first delegate that matches // and unsubscribe it // It actually doesn't matter which delegate - as long as it matches - // Note that inside TryGetValueWithValueEquality we assumes that any delegate + // Note that inside TryGetValueWithValueEquality we assumes that any delegate // with the same value equality would have the same hash code object key = FindEquivalentKeyUnsafe(registrationTokens, handler, out tokens); Debug.Assert((key != null && tokens != null) || (key == null && tokens == null), @@ -736,7 +736,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { // Remove it from (handler)->(tokens) // NOTE: We should not check whether registrationTokens has 0 entries and remove it from the cache - // (just like managed event implementation), because this might have raced with the finalizer of + // (just like managed event implementation), because this might have raced with the finalizer of // EventRegistrationTokenList registrationTokens.Remove(key); } @@ -750,7 +750,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime } // Call removeMethod outside of RW lock - // At this point we don't need to worry about race conditions and we can avoid deadlocks + // At this point we don't need to worry about race conditions and we can avoid deadlocks // if removeMethod waits on finalizer thread removeMethod(token); } @@ -814,13 +814,13 @@ namespace System.Runtime.InteropServices.WindowsRuntime /// /// /// A reader-writer lock implementation that is intended to be simple, yet very - /// efficient. In particular only 1 interlocked operation is taken for any lock + /// efficient. In particular only 1 interlocked operation is taken for any lock /// operation (we use spin locks to achieve this). The spin lock is never held /// for more than a few instructions (in particular, we never call event APIs - /// or in fact any non-trivial API while holding the spin lock). - /// - /// Currently this ReaderWriterLock does not support recursion, however it is - /// not hard to add + /// or in fact any non-trivial API while holding the spin lock). + /// + /// Currently this ReaderWriterLock does not support recursion, however it is + /// not hard to add /// internal class MyReaderWriterLock { @@ -830,20 +830,20 @@ namespace System.Runtime.InteropServices.WindowsRuntime private int myLock; // Who owns the lock owners > 0 => readers - // owners = -1 means there is one writer. Owners must be >= -1. + // owners = -1 means there is one writer. Owners must be >= -1. private int owners; - // These variables allow use to avoid Setting events (which is expensive) if we don't have to. - private uint numWriteWaiters; // maximum number of threads that can be doing a WaitOne on the writeEvent + // These variables allow use to avoid Setting events (which is expensive) if we don't have to. + private uint numWriteWaiters; // maximum number of threads that can be doing a WaitOne on the writeEvent private uint numReadWaiters; // maximum number of threads that can be doing a WaitOne on the readEvent - // conditions we wait on. - private EventWaitHandle writeEvent; // threads waiting to aquire a write lock go here. - private EventWaitHandle readEvent; // threads waiting to aquire a read lock go here (will be released in bulk) + // conditions we wait on. + private EventWaitHandle writeEvent; // threads waiting to acquire a write lock go here. + private EventWaitHandle readEvent; // threads waiting to acquire a read lock go here (will be released in bulk) internal MyReaderWriterLock() { - // All state can start out zeroed. + // All state can start out zeroed. } internal void AcquireReaderLock(int millisecondsTimeout) @@ -852,7 +852,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime for (;;) { // We can enter a read lock if there are only read-locks have been given out - // and a writer is not trying to get in. + // and a writer is not trying to get in. if (owners >= 0 && numWriteWaiters == 0) { // Good case, there is no contention, we are basically done @@ -860,11 +860,11 @@ namespace System.Runtime.InteropServices.WindowsRuntime break; } - // Drat, we need to wait. Mark that we have waiters and wait. - if (readEvent == null) // Create the needed event + // Drat, we need to wait. Mark that we have waiters and wait. + if (readEvent == null) // Create the needed event { LazyCreateEvent(ref readEvent, false); - continue; // since we left the lock, start over. + continue; // since we left the lock, start over. } WaitOnEvent(readEvent, ref numReadWaiters, millisecondsTimeout); @@ -888,7 +888,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime if (writeEvent == null) // create the needed event. { LazyCreateEvent(ref writeEvent, true); - continue; // since we left the lock, start over. + continue; // since we left the lock, start over. } WaitOnEvent(writeEvent, ref numWriteWaiters, millisecondsTimeout); @@ -916,7 +916,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime /// A routine for lazily creating a event outside the lock (so if errors /// happen they are outside the lock and that we don't do much work /// while holding a spin lock). If all goes well, reenter the lock and - /// set 'waitEvent' + /// set 'waitEvent' /// private void LazyCreateEvent(ref EventWaitHandle waitEvent, bool makeAutoResetEvent) { @@ -930,12 +930,12 @@ namespace System.Runtime.InteropServices.WindowsRuntime else newEvent = new ManualResetEvent(false); EnterMyLock(); - if (waitEvent == null) // maybe someone snuck in. + if (waitEvent == null) // maybe someone snuck in. waitEvent = newEvent; } /// - /// Waits on 'waitEvent' with a timeout of 'millisceondsTimeout. + /// Waits on 'waitEvent' with a timeout of 'millisceondsTimeout. /// Before the wait 'numWaiters' is incremented and is restored before leaving this routine. /// private void WaitOnEvent(EventWaitHandle waitEvent, ref uint numWaiters, int millisecondsTimeout) @@ -946,7 +946,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime numWaiters++; bool waitSuccessful = false; - ExitMyLock(); // Do the wait outside of any lock + ExitMyLock(); // Do the wait outside of any lock try { if (!waitEvent.WaitOne(millisecondsTimeout, false)) @@ -958,13 +958,13 @@ namespace System.Runtime.InteropServices.WindowsRuntime { EnterMyLock(); --numWaiters; - if (!waitSuccessful) // We are going to throw for some reason. Exit myLock. + if (!waitSuccessful) // We are going to throw for some reason. Exit myLock. ExitMyLock(); } } /// - /// Determines the appropriate events to set, leaves the locks, and sets the events. + /// Determines the appropriate events to set, leaves the locks, and sets the events. /// private void ExitAndWakeUpAppropriateWaiters() { @@ -973,12 +973,12 @@ namespace System.Runtime.InteropServices.WindowsRuntime if (owners == 0 && numWriteWaiters > 0) { ExitMyLock(); // Exit before signaling to improve efficiency (wakee will need the lock) - writeEvent.Set(); // release one writer. + writeEvent.Set(); // release one writer. } else if (owners >= 0 && numReadWaiters != 0) { ExitMyLock(); // Exit before signaling to improve efficiency (wakee will need the lock) - readEvent.Set(); // release all readers. + readEvent.Set(); // release all readers. } else ExitMyLock(); @@ -995,9 +995,9 @@ namespace System.Runtime.InteropServices.WindowsRuntime for (int i = 0; ; i++) { if (i < 3 && Environment.ProcessorCount > 1) - Thread.SpinWait(20); // Wait a few dozen instructions to let another processor release lock. + Thread.SpinWait(20); // Wait a few dozen instructions to let another processor release lock. else - Thread.Sleep(0); // Give up my quantum. + Thread.Sleep(0); // Give up my quantum. if (Interlocked.CompareExchange(ref myLock, 1, 0) == 0) return; @@ -1210,8 +1210,8 @@ namespace System.Runtime.InteropServices.WindowsRuntime // // Get activation factory object for a specified WinRT type // If the WinRT type is a native type, we'll always create a unique RCW for it, - // This is necessary because WinRT factories are often implemented as a singleton, - // and getting back a RCW for such WinRT factory would usually get back a RCW from + // This is necessary because WinRT factories are often implemented as a singleton, + // and getting back a RCW for such WinRT factory would usually get back a RCW from // another apartment, even if the interface pointe returned from GetActivationFactory // is a raw pointer. As a result, user would randomly get back RCWs for activation // factories from other apartments and make transiton to those apartments and cause @@ -1230,7 +1230,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { #if FEATURE_COMINTEROP_WINRT_MANAGED_ACTIVATION return GetManagedActivationFactory(type); -#else +#else // Managed factories are not supported so as to minimize public surface (and test effort) throw new NotSupportedException(); #endif diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Threading/Tasks/IAsyncCausalityTracerStatics.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Threading/Tasks/IAsyncCausalityTracerStatics.cs index 17dd1f8..a09279c 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Threading/Tasks/IAsyncCausalityTracerStatics.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Threading/Tasks/IAsyncCausalityTracerStatics.cs @@ -42,7 +42,7 @@ namespace Windows.Foundation.Diagnostics // We need this dummy class to satisfy a QI when the TracingStatusChangedHandler // after being stored in a GIT cookie and then called by the WinRT API. This usually - // happens when calling a MAnaged WinMD which access this feature. + // happens when calling a Managed WinMD which access this feature. [ComImport] [Guid("410B7711-FF3B-477F-9C9A-D2EFDA302DC3")] [WindowsRuntimeImport] diff --git a/src/coreclr/tests/src/Interop/MarshalAPI/OffsetOf/OffsetOf.cs b/src/coreclr/tests/src/Interop/MarshalAPI/OffsetOf/OffsetOf.cs index 6b28401..b56155a 100644 --- a/src/coreclr/tests/src/Interop/MarshalAPI/OffsetOf/OffsetOf.cs +++ b/src/coreclr/tests/src/Interop/MarshalAPI/OffsetOf/OffsetOf.cs @@ -95,7 +95,7 @@ internal struct ExplicitLayoutTest // 7 bytes of padding } -internal struct FieldAlignementTest +internal struct FieldAlignmentTest { public byte m_byte1; // 1 byte // 1 byte of padding @@ -127,7 +127,7 @@ internal struct FieldAlignementTest // 7 bytes of padding } -struct FieldAlignementTest_Decimal +struct FieldAlignmentTest_Decimal { public byte b; // 1 byte // 7 bytes of padding @@ -137,13 +137,13 @@ struct FieldAlignementTest_Decimal // This is because unlike fields of other types well known to mcg (like long, char etc.) // which need to be aligned according to their byte size, decimal is really a struct // with 8 byte alignment requirement. - public FieldAlignementTest p; // 80 bytes (72 bytes on x86/Unix) + public FieldAlignmentTest p; // 80 bytes (72 bytes on x86/Unix) public short s; // 2 bytes // 6 bytes of padding } -struct FieldAlignementTest_Guid +struct FieldAlignmentTest_Guid { public byte b; // 1 byte // 3 bytes of padding @@ -155,7 +155,7 @@ struct FieldAlignementTest_Guid // 2 bytes of padding } -struct FieldAlignementTest_Variant +struct FieldAlignmentTest_Variant { public byte b; // 1 byte // 7 bytes of padding @@ -171,7 +171,7 @@ struct FieldAlignementTest_Variant public class OffsetTest { - + public static void NullParameter() { Assert.Throws(() => Marshal.OffsetOf(null, null)); @@ -179,25 +179,25 @@ public class OffsetTest Assert.Throws(() => Marshal.OffsetOf(null, "abcd")); } - + public static void NonExistField() { Assert.Throws(() => Marshal.OffsetOf(typeof(NonExistField), "NonExistField")); } - + public static void NoLayoutClass() { Assert.Throws(() => Marshal.OffsetOf(typeof(NoLayoutPoint), "x")); } - + public static void StructField() { Assert.AreEqual(new IntPtr(4), Marshal.OffsetOf(typeof(someStruct), "var")); } - + public static void ClassExplicitField() { Assert.AreEqual(new IntPtr(0), Marshal.OffsetOf(typeof(MySystemTime), "wYear")); @@ -205,24 +205,24 @@ public class OffsetTest Assert.AreEqual(new IntPtr(14), Marshal.OffsetOf(typeof(MySystemTime), "wMilliseconds")); } - + public static void ClassSequentialField() { Assert.AreEqual(new IntPtr(0), Marshal.OffsetOf(typeof(MyPoint), "x")); Assert.AreEqual(new IntPtr(4), Marshal.OffsetOf(typeof(MyPoint), "y")); } - + public static void ProjectedType() { -#if BUG_1212387 +#if BUG_1212387 Assert.AreEqual(new IntPtr(0), Marshal.OffsetOf(typeof(Windows.Foundation.Point), "_x")); Assert.AreEqual(new IntPtr(1), Marshal.OffsetOf(typeof(Windows.UI.Color), "_R")); -#endif +#endif } - + public static void TestExplicitLayout() { var t = typeof(ExplicitLayoutTest); @@ -247,10 +247,10 @@ public class OffsetTest Assert.AreEqual(new IntPtr(48), Marshal.OffsetOf(t, "m_char1")); } - + public static void TestFieldAlignment() { - var t = typeof(FieldAlignementTest); + var t = typeof(FieldAlignmentTest); if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) || (RuntimeInformation.ProcessArchitecture != Architecture.X86)) { Assert.AreEqual(80, Marshal.SizeOf(t)); @@ -293,10 +293,10 @@ public class OffsetTest } } - + public static void TestFieldAlignment_Decimal() { - var t = typeof(FieldAlignementTest_Decimal); + var t = typeof(FieldAlignmentTest_Decimal); if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) || (RuntimeInformation.ProcessArchitecture != Architecture.X86)) { @@ -320,10 +320,10 @@ public class OffsetTest } } - + public static void TestFieldAlignment_Guid() { - var t = typeof(FieldAlignementTest_Guid); + var t = typeof(FieldAlignmentTest_Guid); Assert.AreEqual(24, Marshal.SizeOf(t)); Assert.AreEqual(new IntPtr(0), Marshal.OffsetOf(t, "b")); @@ -331,10 +331,10 @@ public class OffsetTest Assert.AreEqual(new IntPtr(20), Marshal.OffsetOf(t, "s")); } - + public static void TestFieldAlignment_Variant() { - var t = typeof(FieldAlignementTest_Variant); + var t = typeof(FieldAlignmentTest_Variant); Assert.AreEqual(new IntPtr(0), Marshal.OffsetOf(t, "b")); Assert.AreEqual(new IntPtr(8), Marshal.OffsetOf(t, "v")); @@ -357,7 +357,7 @@ public class OffsetTest public static int Main(String[] args) { - //https://github.com/dotnet/coreclr/issues/2075 + //https://github.com/dotnet/coreclr/issues/2075 //TestFieldAlignment_Variant(); TestFieldAlignment_Guid(); TestFieldAlignment_Decimal(); diff --git a/src/coreclr/tests/src/JIT/Methodical/inlining/bug505642/test.cs b/src/coreclr/tests/src/JIT/Methodical/inlining/bug505642/test.cs index e54c000..94153f8 100644 --- a/src/coreclr/tests/src/JIT/Methodical/inlining/bug505642/test.cs +++ b/src/coreclr/tests/src/JIT/Methodical/inlining/bug505642/test.cs @@ -5,7 +5,7 @@ /* * Some comments about the test: * Expected: The code runs and completes successfully. - * Acutal: The application hangs when it is run. + * Actual: The application hangs when it is run. * The csharp compiler seems to be generating the same IL in both the cases. * * Some comments about the bug: diff --git a/src/coreclr/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/b152292/b152292.cs b/src/coreclr/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/b152292/b152292.cs index 1b816ce..f430833 100644 --- a/src/coreclr/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/b152292/b152292.cs +++ b/src/coreclr/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/b152292/b152292.cs @@ -4,11 +4,11 @@ // /* - On windows the address range from 0 - 64 kb is protected + On windows the address range from 0 - 64 kb is protected by the os, if code tries to access it, an access violation is triggered, which is translated into a NullReferenceException by the runtime. If the offset to the field of the class is above - 32 KB, we add some addtional code that checks for null accesses. The address range on mac is - much smaller, 0-4 KB, and if the field offset is above 2 KB we are adding this additional code again. + 32 KB, we add some additional code that checks for null accesses. The address range on mac is + much smaller, 0-4 KB, and if the field offset is above 2 KB we are adding this additional code again. */ using System; diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/TextWriter.cs b/src/libraries/System.Private.CoreLib/src/System/IO/TextWriter.cs index 22a8cd6..c41dabd 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/TextWriter.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/TextWriter.cs @@ -13,24 +13,24 @@ using System.Buffers; namespace System.IO { // This abstract base class represents a writer that can write a sequential - // stream of characters. A subclass must minimally implement the + // stream of characters. A subclass must minimally implement the // Write(char) method. // - // This class is intended for character output, not bytes. - // There are methods on the Stream class for writing bytes. + // This class is intended for character output, not bytes. + // There are methods on the Stream class for writing bytes. public abstract partial class TextWriter : MarshalByRefObject, IDisposable { public static readonly TextWriter Null = new NullTextWriter(); - // We don't want to allocate on every TextWriter creation, so cache the char array. + // We don't want to allocate on every TextWriter creation, so cache the char array. private static readonly char[] s_coreNewLine = Environment.NewLine.ToCharArray(); /// - /// This is the 'NewLine' property expressed as a char[]. + /// This is the 'NewLine' property expressed as a char[]. /// It is exposed to subclasses as a protected field for read-only - /// purposes. You should only modify it by using the 'NewLine' property. - /// In particular you should never modify the elements of the array - /// as they are shared among many instances of TextWriter. + /// purposes. You should only modify it by using the 'NewLine' property. + /// In particular you should never modify the elements of the array + /// as they are shared among many instances of TextWriter. /// protected char[] CoreNewLine = s_coreNewLine; private string CoreNewLineStr = Environment.NewLine; @@ -94,7 +94,7 @@ namespace System.IO /// /// Returns the line terminator string used by this TextWriter. The default line - /// terminator string is Environment.NewLine, which is platform specific. + /// terminator string is Environment.NewLine, which is platform specific. /// On Windows this is a carriage return followed by a line feed ("\r\n"). /// On OSX and Linux this is a line feed ("\n"). /// @@ -219,8 +219,8 @@ namespace System.IO Write(value.ToString(FormatProvider)); } - // Writes the text representation of an unsigned long to the text - // stream. The text representation of the given value is produced + // Writes the text representation of an unsigned long to the text + // stream. The text representation of the given value is produced // by calling the UInt64.ToString() method. // [CLSCompliant(false)] @@ -285,7 +285,7 @@ namespace System.IO /// /// Equivalent to Write(stringBuilder.ToString()) however it uses the - /// StringBuilder.GetChunks() method to avoid creating the intermediate string + /// StringBuilder.GetChunks() method to avoid creating the intermediate string /// /// The string (as a StringBuilder) to write to the stream public virtual void Write(StringBuilder value) @@ -300,7 +300,7 @@ namespace System.IO // Writes out a formatted string. Uses the same semantics as // String.Format. - // + // public virtual void Write(string format, object arg0) { Write(string.Format(FormatProvider, format, arg0)); @@ -308,7 +308,7 @@ namespace System.IO // Writes out a formatted string. Uses the same semantics as // String.Format. - // + // public virtual void Write(string format, object arg0, object arg1) { Write(string.Format(FormatProvider, format, arg0, arg1)); @@ -316,7 +316,7 @@ namespace System.IO // Writes out a formatted string. Uses the same semantics as // String.Format. - // + // public virtual void Write(string format, object arg0, object arg1, object arg2) { Write(string.Format(FormatProvider, format, arg0, arg1, arg2)); @@ -324,7 +324,7 @@ namespace System.IO // Writes out a formatted string. Uses the same semantics as // String.Format. - // + // public virtual void Write(string format, params object[] arg) { Write(string.Format(FormatProvider, format, arg)); @@ -398,7 +398,7 @@ namespace System.IO WriteLine(); } - // Writes the text representation of an unsigned integer followed by + // Writes the text representation of an unsigned integer followed by // a line terminator to the text stream. // [CLSCompliant(false)] @@ -417,7 +417,7 @@ namespace System.IO WriteLine(); } - // Writes the text representation of an unsigned long followed by + // Writes the text representation of an unsigned long followed by // a line terminator to the text stream. // [CLSCompliant(false)] @@ -464,7 +464,7 @@ namespace System.IO /// /// Equivalent to WriteLine(stringBuilder.ToString()) however it uses the - /// StringBuilder.GetChunks() method to avoid creating the intermediate string + /// StringBuilder.GetChunks() method to avoid creating the intermediate string /// public virtual void WriteLine(StringBuilder value) { @@ -497,33 +497,33 @@ namespace System.IO } } - // Writes out a formatted string and a new line. Uses the same + // Writes out a formatted string and a new line. Uses the same // semantics as String.Format. - // + // public virtual void WriteLine(string format, object arg0) { WriteLine(string.Format(FormatProvider, format, arg0)); } - // Writes out a formatted string and a new line. Uses the same + // Writes out a formatted string and a new line. Uses the same // semantics as String.Format. - // + // public virtual void WriteLine(string format, object arg0, object arg1) { WriteLine(string.Format(FormatProvider, format, arg0, arg1)); } - // Writes out a formatted string and a new line. Uses the same + // Writes out a formatted string and a new line. Uses the same // semantics as String.Format. - // + // public virtual void WriteLine(string format, object arg0, object arg1, object arg2) { WriteLine(string.Format(FormatProvider, format, arg0, arg1, arg2)); } - // Writes out a formatted string and a new line. Uses the same + // Writes out a formatted string and a new line. Uses the same // semantics as String.Format. - // + // public virtual void WriteLine(string format, params object[] arg) { WriteLine(string.Format(FormatProvider, format, arg)); @@ -554,12 +554,12 @@ namespace System.IO /// /// Equivalent to WriteAsync(stringBuilder.ToString()) however it uses the - /// StringBuilder.GetChunks() method to avoid creating the intermediate string + /// StringBuilder.GetChunks() method to avoid creating the intermediate string /// /// The string (as a StringBuilder) to write to the stream public virtual Task WriteAsync(StringBuilder value, CancellationToken cancellationToken = default) { - // Do the agument checking before 'going async' so you get it early + // Do the argument checking before 'going async' so you get it early if (value == null) { throw new ArgumentNullException(nameof(value)); @@ -628,7 +628,7 @@ namespace System.IO /// /// Equivalent to WriteLineAsync(stringBuilder.ToString()) however it uses the - /// StringBuilder.GetChunks() method to avoid creating the intermediate string + /// StringBuilder.GetChunks() method to avoid creating the intermediate string /// /// The string (as a StringBuilder) to write to the stream public async virtual Task WriteLineAsync(StringBuilder value, CancellationToken cancellationToken = default)