&& apt-get install libgbm-dev -y \
&& apt-get install libpango-1.0-0 -y \
&& apt-get install libcairo2 -y \
- && apt-get install libasound2 -y
+ && apt-get install libasound2 -y
-#install firefox dependecies to run debugger tests:
+# install firefox dependencies to run debugger tests:
RUN sudo apt-get install libdbus-glib-1-2 -y \
&& apt-get install libgtk-3-0 -y \
- && apt-get install libx11-xcb-dev -y
\ No newline at end of file
+ && apt-get install libx11-xcb-dev -y
If you initialize the crst as CRST_HOST_BREAKABLE, any attempt to acquire the lock can trigger an exception (intended to kill your thread to break the deadlock.) Otherwise, you are guaranteed not to get an exception or failure. Regardless of the flag setting, releasing a lock will never fail.
-You can only use a non host-breakable lock if you can guarantee that that lock will never participate in a deadlock. If you cannot guarantee this, you must use a host-breakable lock and handle the exception. Otherwise, a CLR host will not be able to break deadlocks cleanly.
+You can only use a non host-breakable lock if you can guarantee that the lock will never participate in a deadlock. If you cannot guarantee this, you must use a host-breakable lock and handle the exception. Otherwise, a CLR host will not be able to break deadlocks cleanly.
There are several ways we enforce this.
## Non-Virtual calls as the baseline solution to all other versioning issues
-It is important to observe that once you have a mechanism for doing non-virtual function calls in a version resilient way (by having an indirect CALL through a slot that that can be fixed lazily at runtime, all other versioning problems _can_ be solved in that way by calling back to the 'definer' module, and having the operation occur there instead. Issues associated with this technique
+It is important to observe that once you have a mechanism for doing non-virtual function calls in a version resilient way (by having an indirect CALL through a slot that can be fixed lazily at runtime, all other versioning problems _can_ be solved in that way by calling back to the 'definer' module, and having the operation occur there instead. Issues associated with this technique
1. You will pay the cost of a true indirection function call and return, as well as any argument setup cost. This cost may be visible in constructs that do not contain a call naturally, like fetching string literals or other constants. You may be able to get better performance from another technique (for example, we did so with instance field access).
2. It introduces a lot of indirect calls. It is not friendly to systems that disallow on the fly code generation. A small helper stub has to be created at runtime in the most straightforward implementation, or there has to be a scheme how to pre-create or recycle the stubs.
Our goal is to generate core dumps that are on par with WER (Windows Error Reporting) crash dumps on any supported Linux platform. To the very least we want to enable the following:
- automatic generation of minimal size minidumps. The quality and quantity of the information contained in the dump should be on par with the information contained in a traditional Windows mini-dump.
-- simple configurabilty by the user (not _su_!).
+- simple configurability by the user (not _su_!).
Our solution at this time is to intercept any unhandled exception in the PAL layer of the runtime and have coreclr itself trigger and generate a "mini" core dump.
* Only simple objects are stack allocated, arrays of constant size are not analyzed.
* Only objects that are allocated unconditionally in the method are moved to the stack. An improvement here would
be allocating other objects dynamically on the stack.
-* If at least one object in a method is stack allocated, all objects are conservatively reported as as TYPE_GC_BYREF
+* If at least one object in a method is stack allocated, all objects are conservatively reported as TYPE_GC_BYREF
and a checked write barrier is used in the method.
* All objects allocated on the stack also have a pre-header allocated. Pre-header is used for synchronization
and hashing so we could eliminate it if we proved the object wasn't used for synchronization and hashing.
- `CORECLR_PROFILER={_CLSID of profiler_}`
# Finding the profiler library
-Once profiling is enabled there are two ways we load your profiler, with enviroment variables (cross-plat) or through the registry (Windows only)
+Once profiling is enabled there are two ways we load your profiler, with environment variables (cross-plat) or through the registry (Windows only)
## Environment Variable (cross-plat)
Set one of the following (if all are set, the bitness-specific variables take precedence). The 32/64 ones specify which bitness of profiler is loaded
[in, size_is(cFunctions)] mdMethodDef methodIds[]);
```
-Conceptually this works the same as `ICorProfilerInfo4::RequestReJIT` except it will automatically ReJIT any methods that have inlined the target method(s) in the past. The arguments are the same except for the additon of `dwRejitFlags` as the first parameter. The valid values for this argument come from this enum:
+Conceptually this works the same as `ICorProfilerInfo4::RequestReJIT` except it will automatically ReJIT any methods that have inlined the target method(s) in the past. The arguments are the same except for the addition of `dwRejitFlags` as the first parameter. The valid values for this argument come from this enum:
```cpp
typedef enum
There are two fundamental ways your profiler can catch up on the current state of an application:
-- Lazy catch-up—as the profiler encounters new IDs, the profiler queries information about those IDs as it needs them, rather than assuming it has a full cache that’s always built up as the IDs are first created. This is analogous to Dorothy meeting a new grown-up, and gracefully accepting the fact that that person exists.
+- Lazy catch-up—as the profiler encounters new IDs, the profiler queries information about those IDs as it needs them, rather than assuming it has a full cache that’s always built up as the IDs are first created. This is analogous to Dorothy meeting a new grown-up, and gracefully accepting the fact that the person exists.
- Enumeration—for certain kinds of IDs, the profiler can (at attach time) request a complete list of the currently active IDs and query information about them at that time. Sort of like Dorothy first going to the Oz City Hall and looking up the birth records for everyone.
Lazy catch-up is fairly self-explanatory. For example, if your sampling profiler encounters an IP in a FunctionID you’ve never seen before, just look up whatever info you need about that FunctionID the first time you encounter it, rather than assuming you’d already built up a cache when the function was first JITted. And if you discover that FunctionID resides in a module you’ve never seen before, then just look up whatever info you need about that ModuleID at that point, rather than assuming you already have a complete cache of all modules. Many of you are already doing something like this today if you support sampling against regular NGENd images (since you don’t get JIT notifications of those functions anyway).
}
```
Note this API is not exposed outside of `System.Private.CoreLib` and is subject to change at any time.
- * The loading of the assembly will take place in a new [`AssemblyLoadContext`](https://docs.microsoft.com/dotnet/api/system.runtime.loader.assemblyloadcontext) for dependency isolation. Each assembly path will get a seperate `AssemblyLoadContext`. This means that if an assembly provides multiple COM servers all of the servers from that assembly will reside in the same `AssemblyLoadContext`.
+ * The loading of the assembly will take place in a new [`AssemblyLoadContext`](https://docs.microsoft.com/dotnet/api/system.runtime.loader.assemblyloadcontext) for dependency isolation. Each assembly path will get a separate `AssemblyLoadContext`. This means that if an assembly provides multiple COM servers all of the servers from that assembly will reside in the same `AssemblyLoadContext`.
* The created `AssemblyLoadContext` will use an [`AssemblyDependencyResolver`](https://github.com/dotnet/runtime/issues/27787) that was supplied with the path to the assembly to load assemblies.
1) The `IClassFactory` instance is returned to the caller of `DllGetClassObject()` to attempt class activation.
### Principles
1. Ahead of time generated code exists to improve startup, and for some scenarios will be retained for the lifetime of the process.
-2. Our default scenario relies on on tiered compilation rejit for best performance.
+2. Our default scenario relies on tiered compilation rejit for best performance.
3. Too much pregenerated code will negatively affect applications. Startup is the critical detail for most pregeneration scenarios, and for those, there is a blend of time to pull the file to the CPU (from disk, over the network, etc.) and to compile functions. Striking the right blend has been discovered to be critical.
### Proposed approach
#### Option 5 (Selected Design): Only `GeneratedComInterfaceAttribute` attribute with Generated `ComWrappers`-derived type
-The built-in `ComImport` and `ComVisible` attributes have a lot of history and weird runtime behavior associated with them. Additionally the built-in `ComVisible` attribute actually takes a `bool` to determine if the applied to type is visible and it can be applied to methods as well to enable/disable COM visbility for the legacy automatic COM vtable generation that the .NET runtime has supported since .NET Framework 1.0. This option proposes introducing a single new attribute to cover the expected scenarios:
+The built-in `ComImport` and `ComVisible` attributes have a lot of history and weird runtime behavior associated with them. Additionally the built-in `ComVisible` attribute actually takes a `bool` to determine if the applied to type is visible and it can be applied to methods as well to enable/disable COM visibility for the legacy automatic COM vtable generation that the .NET runtime has supported since .NET Framework 1.0. This option proposes introducing a single new attribute to cover the expected scenarios:
```csharp
[AttributeUsage(AttributeTargets.Interface)]
For example, each of the following experiences requires different runtime
capabilities:
-- Developer inner loop on on a mobile or WebAssembly workload: The runtime
+- Developer inner loop on a mobile or WebAssembly workload: The runtime
should include support for the interpreter, hot reload, and the diagnostic
server.
- Release build iPhone app for the app store: The runtime should not include the
| TFM | [Target Framework Moniker](https://docs.microsoft.com/dotnet/standard/frameworks) such as `net6.0` or `netstandard2.0`. |
| TPA | Trusted Platform Assemblies used to be a special set of assemblies that comprised the platform assemblies, when it was originally designed. As of today, it is simply the set of assemblies known to constitute the application. |
| URT | Universal Runtime. Ancient name for what ended up being .NET, is used in the WinError facility name FACILITY_URT. |
-| UTC | [Universal Tuple Compiler](https://blogs.msdn.microsoft.com/vcblog/2013/06/12/optimizing-c-code-overview/). The Microsoft C++ optimizer back-end that that starts by converting the information from the FrontEnd into tuples – a binary stream of instructions. |
+| UTC | [Universal Tuple Compiler](https://blogs.msdn.microsoft.com/vcblog/2013/06/12/optimizing-c-code-overview/). The Microsoft C++ optimizer back-end that starts by converting the information from the FrontEnd into tuples – a binary stream of instructions. |
| UWP | [Universal Windows Platform (UWP)](https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide) is a platform-homogeneous application architecture available on every device that runs Windows 10. |
| VSD | [Virtual Stub Dispatch](../design/coreclr/botr/virtual-stub-dispatch.md). Technique of using stubs for virtual method invocations instead of the traditional virtual method table. |
| VM | Virtual machine. |
message("Address Sanitizer (asan) enabled")
endif ()
if (${__UBSAN_POS} GREATER -1)
- # all sanitizier flags are enabled except alignment (due to heavy use of __unaligned modifier)
+ # all sanitizer flags are enabled except alignment (due to heavy use of __unaligned modifier)
list(APPEND CLR_CXX_SANITIZERS
"bool"
bounds
<PropertyGroup Condition="'$(PreReleaseVersionLabel)' == 'servicing'">
<!-- If no servicing version is set we need to default to 0 in order for dependency versions to
- be calculated propertly, if we don't set it to 0, we would get the dependency version using the
+ be calculated properly, if we don't set it to 0, we would get the dependency version using the
product Patch Version -->
<ServicingVersion Condition="'$(ServicingVersion)' == ''">0</ServicingVersion>
</ItemGroup>
</Target>
- <Target Name="ValidateAssemblyVersionsInRefPack"
+ <Target Name="ValidateAssemblyVersionsInRefPack"
Condition="'$(SkipValidateAssemblyVersion)' != 'true' and '$(_AssemblyInTargetingPack)' == 'true' and '$(PreReleaseVersionLabel)' == 'servicing'"
AfterTargets="CoreCompile" >
<Error Condition="'$(AssemblyVersion)' != '$(LastReleasedStableAssemblyVersion)'" Text="AssemblyVersion should match last released assembly version $(LastReleasedStableAssemblyVersion)" />
</Target>
- <Target Name="ValidateServicingVersionIsPropertlySet"
+ <Target Name="ValidateServicingVersionIsProperlySet"
Condition="'$(PreReleaseVersionLabel)' == 'servicing' and '$(DotNetBuildFromSource)' != 'true'"
AfterTargets="GenerateNuspec">
<Error Condition="'$(ServicingVersion)' == '0'" Text="ServicingVersion is set to 0 and it should be an increment of the patch version from the last released package." />
- name: buildProductArtifactName
value: 'MonoProduct__${{ parameters.runtimeVariant }}_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)'
- # minijit and monointerpreter do not use seperate product builds.
+ # minijit and monointerpreter do not use separate product builds.
- ${{ if or(eq(parameters.runtimeVariant, 'minijit'), eq(parameters.runtimeVariant, 'monointerpreter')) }}:
- name : buildProductArtifactName
value : 'MonoProduct___$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)'
value: 'Checked'
${{ if eq(parameters.liveRuntimeBuildConfig, 'debug') }}:
value: 'Debug'
-
+
- name: priorityArg
value: ''
// We can destroy the unmanaged part of collectible type only after the managed part is definitely gone and thus
// nobody can call/allocate/reference anything related to the collectible assembly anymore. A call to finalizer
// alone does not guarantee that the managed part is gone. A malicious code can keep a reference to some object
- // in a way that that survives finalization, or we can be running during shutdown where everything is finalized.
+ // in a way that it survives finalization, or we can be running during shutdown where everything is finalized.
//
// The unmanaged LoaderAllocator keeps a reference to the managed LoaderAllocator in long weak handle. If the long
// weak handle is null, we can be sure that the managed part of the LoaderAllocator is definitely gone and that it
return OBJECTREFToObject(refType);
}
-// This routine is called by the Object.GetType() routine. It is a major way to get the Sytem.Type
+// This routine is called by the Object.GetType() routine. It is a major way to get the System.Type
FCIMPL1(Object*, ObjectNative::GetClass, Object* pThis)
{
CONTRACTL
// += sizeOfArgs
// /
// <arg1> /
- // * <this> ;; if an instance method (note: <this> is usally passed in
+ // * <this> ;; if an instance method (note: <this> is usually passed in
// ;; a register and wouldn't appear on the stack frame)
// ;; higher memory
//
}
void
-CrashReportWriter::WriteSeperator(std::string& text)
+CrashReportWriter::WriteSeparator(std::string& text)
{
if (m_comma)
{
CrashReportWriter::OpenValue(const char* key, char marker)
{
std::string text;
- WriteSeperator(text);
+ WriteSeparator(text);
if (key != nullptr)
{
text.append("\"");
CrashReportWriter::WriteValue(const char* key, const char* value)
{
std::string text;
- WriteSeperator(text);
+ WriteSeparator(text);
text.append("\"");
text.append(key);
text.append("\" : \"");
void Write(const std::string& text);
void Write(const char* buffer);
void Indent(std::string& text);
- void WriteSeperator(std::string& text);
+ void WriteSeparator(std::string& text);
void OpenValue(const char* key, char marker);
void CloseValue(char marker);
bool OpenWriter(const char* fileName);
#include "dwbucketmanager.hpp"
#include "gcinterface.dac.h"
-// To include definiton of IsThrowableThreadAbortException
+// To include definition of IsThrowableThreadAbortException
// #include <exstatecommon.h>
CRITICAL_SECTION g_dacCritSec;
memberStart = memberEnd;
- for (;;)
+ while (true)
{
while (memberStart >= fullName &&
*memberStart != W('.'))
// Splay tokens across all app domains.
//
- for (;;)
+ while (true)
{
if (m_lastToken == mdTokenNil)
{
HRESULT status;
LPCUTF8 tokNamespace, tokName;
- for (;;)
+ while (true)
{
if ((status = NextToken(token, &tokNamespace, &tokName)) != S_OK)
{
// Splay tokens across all app domains.
//
- for (;;)
+ while (true)
{
if (m_lastToken == mdTokenNil)
{
// Splay fields across all app domains.
//
- for (;;)
+ while (true)
{
if (!split->m_lastField)
{
// forget all the internal pointers.
//
- for (;;)
+ while (true)
{
FreeAllBlocks(fSaveBlock);
Thread* thread = task ? ((ClrDataTask*)task)->GetThread() : NULL;
ULONG32 loops = 4;
- for (;;)
+ while (true)
{
if ((status = FollowStubStep(thread,
inFlags,
ulSize = assembly->GetLoadedLayout()->GetSize();
}
- // memory are mapped in in GetOsPageSize() size.
+ // memory are mapped in GetOsPageSize() size.
// Some memory are mapped in but some are not. You cannot
// write all in one block. So iterating through page size
//
if (!pThread->IsAddressInStack(currentSP))
{
- _ASSERTE(!"Target stack has been corrupted, SP must in in the stack range.");
+ _ASSERTE(!"Target stack has been corrupted, SP must in the stack range.");
break;
}
}
EX_TRY
{
- for (;;)
+ while (true)
{
mdMethodDef token;
EX_TRY
{
- for (;;)
+ while (true)
{
mdMethodDef token;
// XXX Microsoft - Generics issues?
// Question - what does the GetCl return return here? The underlying element type?
- // If so, we are lossing informaiton.
+ // If so, we are lossing information.
//
defType = m_typeHandle;
*typeDefinition = new (nothrow)
#include <msodw.h>
#endif // TARGET_UNIX
-// To include definiton of IsThrowableThreadAbortException
+// To include definition of IsThrowableThreadAbortException
#include <exstatecommon.h>
#include "rejit.h"
#define ARRAY_CACHE_SIZE (1000)
#else
// For release, guess 4 pages should be enough. Subtract some bytes to store
-// the header so that that doesn't push us onto another page. (We guess a reasonable
+// the header so that it doesn't push us onto another page. (We guess a reasonable
// header size, but it's ok if it's larger).
#define ARRAY_CACHE_SIZE (4 * 4096 - 24)
#endif
// The comparison is done via continue counters. The counter of the load
// event is cached via code:CordbModule::SetLoadEventContinueMarker.
//
-// This state is currently stored on the RS. Alternatively, it could likely be retreived from the LS state as
+// This state is currently stored on the RS. Alternatively, it could likely be retrieved from the LS state as
// well. One disadvantage of the current model is that if we detach during the load-module callback and
// then reattach, the RS state is flushed and we lose the fact that we can toggle the jit flags.
HRESULT CordbModule::EnsureModuleIsInLoadCallback()
m_pClauses[i].TryLength = pClauses[i].TryLength;
m_pClauses[i].HandlerOffset = pClauses[i].HandlerOffset;
m_pClauses[i].HandlerLength = pClauses[i].HandlerLength;
- // these two fields are a union in the image, but are seperate in the struct ICorDebug returns
+ // these two fields are a union in the image, but are separate in the struct ICorDebug returns
m_pClauses[i].ClassToken = isFilter ? 0 : pClauses[i].ClassToken;
m_pClauses[i].FilterOffset = isFilter ? pClauses[i].FilterOffset : 0;
}
m_pClauses[i].TryLength = pClauses[i].TryLength;
m_pClauses[i].HandlerOffset = pClauses[i].HandlerOffset;
m_pClauses[i].HandlerLength = pClauses[i].HandlerLength;
- // these two fields are a union in the image, but are seperate in the struct ICorDebug returns
+ // these two fields are a union in the image, but are separate in the struct ICorDebug returns
m_pClauses[i].ClassToken = isFilter ? 0 : pClauses[i].ClassToken;
m_pClauses[i].FilterOffset = isFilter ? pClauses[i].FilterOffset : 0;
}
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+
//*****************************************************************************
// File: process.cpp
-//
-
//
//*****************************************************************************
+
#include "stdafx.h"
#include "primitives.h"
#include "safewrap.h"
// runtime then DBI matches DAC. Technically because the DBI only matches runtime on major version number
// runtime and DAC could be from different builds. However because we service all three binaries together
// and DBI always loads the DAC that is sitting in the same directory DAC and DBI generally get tight
-// version coupling. A user with admin privleges could put different builds together and no version check
+// version coupling. A user with admin privileges could put different builds together and no version check
// would ever fail though.
//
// - Desktop and Windows CoreCLR (new architecture)
#endif
// 64 bit windows puts space for the first 6 stack parameters in the CONTEXT structure so that
-// kernel to usermode transitions don't have to allocate a CONTEXT and do a seperate sub rsp
+// kernel to usermode transitions don't have to allocate a CONTEXT and do a separate sub rsp
// to allocate stack spill space for the arguments. This means that writing to P1Home - P6Home
// will overwrite the arguments of some function higher on the stack, very bad. Conceptually you
// can think of these members as not being part of the context, ie they don't represent something
// that they will return when asked for native code. The 1:1 mapping between
// function and code was invalidated by generics but debuggers continue to use
// the old API. When they do we need to have some code to hand them back even
-// though it is an arbitrary instantiation. Note that that the cannonical code
+// though it is an arbitrary instantiation. Note that the cannonical code
// here is merely the first one that a user inspects... it is not guaranteed to
// be the same in each debugging session but once set it will never change. It is
// also definately NOT guaranteed to be the instantation over the runtime type
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+
//*****************************************************************************
// File: RsMain.cpp
//
-
-// Random RS utility stuff, plus root ICorCordbug implementation
+// Random RS utility stuff, plus root ICorDebug implementation
//
//*****************************************************************************
+
#include "stdafx.h"
#include "primitives.h"
#include "safewrap.h"
// 3) The original context present when the hijack was started
//
// Both #1 and #3 are stored in the GetHijackCtx() space so of course you can't
- // have them both. You have have #1 if IsContextSet() is true, otherwise it holds #3
+ // have them both. You have #1 if IsContextSet() is true, otherwise it holds #3.
//
// GenericHijack, FirstChanceHijackForSync, and RaiseExceptionHijack use #1 if available
// and fallback to #3 if not. In other words they use GetHijackCtx() regardless of which thing it holds
// Trivial accessor to mark whether we're interop-debugging.
-// Retreived via code:ShimProcess::IsInteropDebugging
+// Retrieved via code:ShimProcess::IsInteropDebugging
void ShimProcess::SetIsInteropDebugging(bool fIsInteropDebugging)
{
m_fIsInteropDebugging = fIsInteropDebugging;
// ****************************************************************************
// Putting code & #includes, #defines, etc, before the stdafx.h will
// cause the code,etc, to be silently ignored
+//
+
#include "stdafx.h"
#include "openum.h"
#include "../inc/common.h"
#define IsSingleStep(exception) ((exception) == EXCEPTION_SINGLE_STEP)
-
-
-
-
// -------------------------------------------------------------------------
// DebuggerController routines
// -------------------------------------------------------------------------
// If we decide to reorder the list, we'll need to keep the element
// indexed by the hash function as the (sorted)first item. Everything else
- // chains off this element, can can thus stay put.
+ // chains off this element, can thus stay put.
// Thus, either the element we just added is already sorted, or else we'll
// have to move it elsewhere in the list, meaning that we'll have to swap
// the second item & the new item, so that the index points to the proper
ControllerStackInfo *i = (ControllerStackInfo *) data;
- //save this info away for later use
+ // save this info away for later use.
if (i->m_bottomFP == LEAF_MOST_FRAME)
i->m_bottomFP = pInfo->fp;
- // This is part of the targetted fix for issue 650903. (See the other
- // parts in in code:TrackUMChain and code:DebuggerStepper::TrapStepOut.)
+ // This is part of the targetted fix for issue 650903 (see the other
+ // parts in code:TrackUMChain and code:DebuggerStepper::TrapStepOut).
+ //
// pInfo->fIgnoreThisFrameIfSuppressingUMChainFromComPlusMethodFrameGeneric has been
// set by TrackUMChain to help us remember that the current frame we're looking at is
// ComPlusMethodFrameGeneric (we can't rely on looking at pInfo->frame to check
// dude initiating this walk to remind us that our goal in life is to do a Step Out
// during managed-only debugging. These two things together tell us we should ignore
// this frame, rather than erroneously identifying it as the target frame.
+ //
#ifdef FEATURE_COMINTEROP
if(i->m_suppressUMChainFromComPlusMethodFrameGeneric &&
(pInfo->chainReason == CHAIN_ENTER_UNMANAGED) &&
CORDbgSetInstruction((CORDB_ADDRESS_TYPE *)patch->address, patch->opcode);
- //VERY IMPORTANT to zero out opcode, else we might mistake
- //this patch for an active on on ReadMem/WriteMem (see
- //header file comment)
+ // VERY IMPORTANT to zero out opcode, else we might mistake
+ // this patch for an active one on ReadMem/WriteMem (see
+ // header file comment).
InitializePRD(&(patch->opcode));
#if !defined(HOST_OSX) || !defined(HOST_ARM64)
*(unsigned short *) (breakpointWriterHolder.GetRW()+1)
= (unsigned short) patch->opcode;
#endif //this makes no sense on anything but X86
- //VERY IMPORTANT to zero out opcode, else we might mistake
- //this patch for an active on on ReadMem/WriteMem (see
- //header file comment
+
+ // VERY IMPORTANT to zero out opcode, else we might mistake
+ // this patch for an active one on ReadMem/WriteMem (see
+ // header file comment.
InitializePRD(&(patch->opcode));
if (!VirtualProtect((void *) patch->address, 2, oldProt, &oldProt))
SIZE_T masterILOffset = master->offset;
// Loop through all the native offsets mapped to the given IL offset. On x86 the mapping
- // should be 1:1. On WIN64, because there are funclets, we have have an 1:N mapping.
+ // should be 1:1. On WIN64, because there are funclets, we have a 1:N mapping.
DebuggerJitInfo::ILToNativeOffsetIterator it;
for (dji->InitILToNativeOffsetIterator(it, masterILOffset); !it.IsAtEnd(); it.Next())
{
//
-// We have to have a whole seperate function for this because you
+// We have to have a whole separate function for this because you
// can't use __try in a function that requires object unwinding...
//
return;
}
- // LCG methods have their own resolution scope that is seperate from a module
+ // LCG methods have their own resolution scope that is separate from a module
// so they shouldn't have their symbols looked up in the module PDB. Right now
// LCG methods have no symbols so we can just early out, but if they ever
// had some symbols attached we would need a different way of getting to them.
STRESS_LOG0(LF_CORDB, LL_INFO10000, "D::SSCIPCE: sync complete.\n");
- // Synchronizing while in in rude shutdown should be extremely rare b/c we don't
+ // Synchronizing during the rude shutdown should be extremely rare b/c we don't
// TART in rude shutdown. Shutdown must have started after we started to sync.
// We know we're not on the shutdown thread here.
// And we also know we can't block the shutdown thread (b/c it has the TSL and will
// - Failed to spawn jit-attach debugger.
//
// Ultimately, the only thing that matters at the end is whether a debugger
-// is now attached, which is retreived via CORDebuggerAttached().
+// is now attached, which is retrieved via CORDebuggerAttached().
//-----------------------------------------------------------------------------
void Debugger::EnsureDebuggerAttached(Thread * pThread, EXCEPTION_POINTERS * pExceptionInfo, BOOL willSendManagedEvent, BOOL explicitUserRequest)
{
// Note: it's possible that the AppDomain has (or is about to be) unloaded, which could lead to a
// crash when we use the DebuggerModule. Ideally we'd only be using AppDomain IDs here.
// We can't easily convert our ADID to an AppDomain* (SystemDomain::GetAppDomainFromId)
- // because we can't proove that that the AppDomain* would be valid (not unloaded).
+ // because we can't proove that the AppDomain* would be valid (not unloaded).
//
AppDomain *pDomain = pThread->GetDomain();
AppDomain *pResultDomain = ((pDE->m_debuggerModule == NULL) ? pDomain : pDE->m_debuggerModule->GetAppDomain());
}
//
-// This is the function that is called when we determine that a first chance exception really belongs to the Runtime,
-// and that that exception is due to a managed->unmanaged transition. This notifies the Right Side of this and the Right
-// Side fixes up the thread's execution state from there, making sure to remember that it needs to continue to hide the
-// hijack state of the thread.
+// This function is called when we determine that a first chance exception really belongs to the Runtime,
+// and that the exception is due to a managed->unmanaged transition. This notifies the Right Side which
+// fixes up the thread's execution state from there, making sure to remember that it needs to continue
+// to hide the hijack state of the thread.
//
void Debugger::ExceptionForRuntimeHandoffStart(void)
{
return CORDBG_E_FUNC_EVAL_BAD_START_POINT;
}
- // Allocate the breakpoint instruction info for the debugger info in in executable memory.
+ // Allocate the breakpoint instruction info for the debugger info in executable memory.
DebuggerHeap *pHeap = g_pDebugger->GetInteropSafeExecutableHeap_NoThrow();
if (pHeap == NULL)
{
};
// class DebuggerMethodInfoTable: Hash table to hold all the non-JIT related
-// info for each method we see. The JIT infos live in a seperate table
+// info for each method we see. The JIT infos live in a separate table
// keyed by MethodDescs - there may be multiple
// JITted realizations of each MethodDef, e.g. under different generic
// assumptions. Hangs off of the Debugger object.
*
* Does the main body of work (steps 1c onward) for the normal func-eval algorithm detailed at the
* top of this file. The args have already been GC protected and we've transitioned into the appropriate
- * domain (steps 1a & 1b). This has to be a seperate function from GCProtectArgsAndDoNormalFuncEval
+ * domain (steps 1a & 1b). This has to be a separate function from GCProtectArgsAndDoNormalFuncEval
* because otherwise we can't reliably find the right GCFrames to pop when unwinding the stack due to
* an exception on 64-bit platforms (we have some GCFrames outside of the TRY, and some inside,
* and they won't necesarily be layed out sequentially on the stack if they are all in the same function).
uint8_t* e_high = 0;
uint8_t* next_boundary = 0;
#else //USE_REGIONS
- // For no regions the gen number is seperately reduced when we detect the ephemeral seg.
+ // For no regions the gen number is separately reduced when we detect the ephemeral seg.
int gen_num_to_stop = max_generation;
uint8_t* e_high = ephemeral_high;
uint8_t* next_boundary = generation_allocation_start (generation_of (max_generation - 1));
// scan.
static bool GcDhUnpromotedHandlesExist(ScanContext* sc);
- // Rescan the handles for additonal primaries that have been promoted since the last scan. Return true if
+ // Rescan the handles for additional primaries that have been promoted since the last scan. Return true if
// any objects were promoted as a result.
static bool GcDhReScan(ScanContext* sc);
int64_t cacheSizeFromSysctl = 0;
size_t sz = sizeof(cacheSizeFromSysctl);
const bool success = false
- // macOS-arm64: Since macOS 12.0, Apple added ".perflevelX." to determinate cache sizes for efficiency
- // and performance cores separetely. "perflevel0" stands for "performance"
+ // macOS-arm64: Since macOS 12.0, Apple added ".perflevelX." to determinate cache sizes for efficiency
+ // and performance cores separately. "perflevel0" stands for "performance"
|| sysctlbyname("hw.perflevel0.l2cachesize", &cacheSizeFromSysctl, &sz, nullptr, 0) == 0
// macOS-arm64: these report cache sizes for efficiency cores only:
|| sysctlbyname("hw.l3cachesize", &cacheSizeFromSysctl, &sz, nullptr, 0) == 0
HRESULT coreclr::Initialize(
_In_ int propertyCount,
- _In_reads_(propertCount) const char **keys,
- _In_reads_(propertCount) const char **values,
+ _In_reads_(propertyCount) const char **keys,
+ _In_reads_(propertyCount) const char **values,
_In_opt_z_ const char *appDomainName)
{
if (_clrInst != nullptr)
DWORD offsetofAddressOfIndex = (DWORD)offsetof(IMAGE_TLS_DIRECTORY32, AddressOfIndex);
DWORD offsetofAddressOfCallBacks = (DWORD)offsetof(IMAGE_TLS_DIRECTORY32, AddressOfCallBacks);
- // Get memory for for the TLS directory block,as well as a spot for callback chain
+ // Get memory for the TLS directory block,as well as a spot for callback chain
IMAGE_TLS_DIRECTORY32* tlsDir;
if(FAILED(hr=m_pCeeFileGen->GetSectionBlock(tlsDirSec, sizeofdir + sizeofptr, sizeofptr, (void**) &tlsDir))) return(hr);
DWORD* callBackChain = (DWORD*) &tlsDir[1];
DWORD offsetofAddressOfIndex = (DWORD)offsetof(IMAGE_TLS_DIRECTORY64, AddressOfIndex);
DWORD offsetofAddressOfCallBacks = (DWORD)offsetof(IMAGE_TLS_DIRECTORY64, AddressOfCallBacks);
- // Get memory for for the TLS directory block,as well as a spot for callback chain
+ // Get memory for the TLS directory block,as well as a spot for callback chain
IMAGE_TLS_DIRECTORY64* tlsDir;
if(FAILED(hr=m_pCeeFileGen->GetSectionBlock(tlsDirSec, sizeofdir + sizeofptr, sizeofptr, (void**) &tlsDir))) return(hr);
__int64* callBackChain = (__int64*) &tlsDir[1];
if(n) appendStr(out," ");
_gcvt_s(str,64,*((float*)dataPtr), 8);
float df = (float)atof(str);
- // Must compare as underlying bytes, not floating point otherwise optmizier will
+ // Must compare as underlying bytes, not floating point otherwise optimizer will
// try to enregister and comapre 80-bit precision number with 32-bit precision number!!!!
if((*(ULONG*)&df != (ULONG)GET_UNALIGNED_VAL32(dataPtr))||IsSpecialNumber(str))
sprintf_s(str, 64,"0x%08X",(ULONG)GET_UNALIGNED_VAL32(dataPtr));
char *pch;
_gcvt_s(str,64,*((double*)dataPtr), 17);
double df = strtod(str, &pch);
- // Must compare as underlying bytes, not floating point otherwise optmizier will
+ // Must compare as underlying bytes, not floating point otherwise optimizer will
// try to enregister and comapre 80-bit precision number with 64-bit precision number!!!!
if((*(ULONGLONG*)&df != (ULONGLONG)GET_UNALIGNED_VAL64(dataPtr))||IsSpecialNumber(str))
sprintf_s(str, 64, "0x%I64X",(ULONGLONG)GET_UNALIGNED_VAL64(dataPtr));
char szf[32];
_gcvt_s(szf,32,MDDV.m_fltValue, 8);
float df = (float)atof(szf);
- // Must compare as underlying bytes, not floating point otherwise optmizier will
+ // Must compare as underlying bytes, not floating point otherwise optimizer will
// try to enregister and comapre 80-bit precision number with 32-bit precision number!!!!
if((*(ULONG*)&df == MDDV.m_ulValue)&&!IsSpecialNumber(szf))
szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr)," = %s(%s)",KEYWORD("float32"),szf);
_gcvt_s(szf,32,MDDV.m_dblValue, 17);
double df = strtod(szf, &pch); //atof(szf);
szf[31]=0;
- // Must compare as underlying bytes, not floating point otherwise optmizier will
+ // Must compare as underlying bytes, not floating point otherwise optimizer will
// try to enregister and comapre 80-bit precision number with 64-bit precision number!!!!
if((*(ULONGLONG*)&df == MDDV.m_ullValue)&&!IsSpecialNumber(szf))
szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr)," = %s(%s)",KEYWORD("float64"),szf);
else
_gcvt_s(szf,32,(double)f, 8);
float fd = (float)atof(szf);
- // Must compare as underlying bytes, not floating point otherwise optmizier will
+ // Must compare as underlying bytes, not floating point otherwise optimizer will
// try to enregister and comapre 80-bit precision number with 32-bit precision number!!!!
if(((__int32&)fd == v)&&!IsSpecialNumber(szf))
szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), "%-10s %s", pszInstrName, szf);
else
_gcvt_s(szf,32,d, 17);
double df = strtod(szf, &pch); //atof(szf);
- // Must compare as underlying bytes, not floating point otherwise optmizier will
+ // Must compare as underlying bytes, not floating point otherwise optimizer will
// try to enregister and comapre 80-bit precision number with 64-bit precision number!!!!
if (((__int64&)df == v)&&!IsSpecialNumber(szf))
szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), "%-10s %s", pszInstrName, szf);
}
}
- // Note that that is set difference, not subtration
+ // Note that this is set difference, not subtration
void operator -=(const BitVector& arg)
{
WRAPPER_NO_CONTRACT;
// GUID CLR_ID_CORECLR : uuid{8CB8E075-0A91-408E-9228-D66E00A3BFF6}
cpp_quote("EXTERN_GUID(CLR_ID_CORECLR, 0x8CB8E075, 0x0A91, 0x408E, 0x92, 0x28, 0xD6, 0x6E, 0x00, 0xA3, 0xBF, 0xF6 );")
-// This guid first appears in the CoreCLR port to Windows Phone 8 - note that it is seperate from the CoreCLR id because it will
+// This guid first appears in the CoreCLR port to Windows Phone 8 - note that it is separate from the CoreCLR id because it will
// potentially have a different verioning lineage than CoreCLR
// GUID CLR_ID_PHONE_CLR : uuid{E7237E9C-31C0-488C-AD48-324D3E7ED92A}
cpp_quote("EXTERN_GUID(CLR_ID_PHONE_CLR, 0xE7237E9C, 0x31C0, 0x488C, 0xAD, 0x48, 0x32, 0x4D, 0x3E, 0x7E, 0xD9, 0x2A);")
SystemContextSwitchInformation,
SystemRegistryQuotaInformation,
SystemExtendServiceTableInformation,
- SystemPrioritySeperation,
+ SystemPrioritySeparation,
SystemVerifierAddDriverInformation,
SystemVerifierRemoveDriverInformation,
SystemProcessorIdleInformation,
#define ENABLE_CONTRACTS
#endif
-// Finally, only define the implementaiton parts of contracts if this isn't a DAC build.
+// Finally, only define the implementation parts of contracts if this isn't a DAC build.
#if defined(_DEBUG_IMPL) && defined(ENABLE_CONTRACTS)
#define ENABLE_CONTRACTS_IMPL
#endif
{
/*
* All callbacks are called with the process in the synchronized state
- * All callbacks are serialized, and are called in in the same thread.
+ * All callbacks are serialized, and are called in the same thread.
* Each callback implementor must call Continue in a callback to
* resume execution.
* If Continue is not called before returning, the process will
[in, size_is(nTypeArgs)] ICorDebugType *ppTypeArgs[]);
/*
- * NewParamaterizedArray allocates a new array whose elements may be instances
+ * NewParameterizedArray allocates a new array whose elements may be instances
* of a generic type. The array is always created in the AppDomain the thread is
* currently in.
*/
* GetClass and the relevant metadata, but it is relatively painful: you would
* have to lookup the class, then the metadata of that class
* to find the "generic" base type, then instantiate this generic base type by
- * looking up the type paramaters to the initial type,
+ * looking up the type parameters to the initial type,
* and then perform the appropriate instantiation in the case where the class
* happens to be either a generic class or a normal class with a constructed type
* as its parent. Looking up the base types is useful to implement common
have managed thread local statics, which work through the HELPER. Support for this is considered
legacy, and going forward, the EE should
- * <NONE> This is a normal static field. Its address in in memory is determined by getFieldAddress. (see
+ * <NONE> This is a normal static field. Its address in memory is determined by getFieldAddress. (see
also CORINFO_FLG_STATIC_IN_HEAP).
virtual bool logMsg(unsigned level, const char* fmt, va_list args) = 0;
// do an assert. will return true if the code should retry (DebugBreak)
- // returns false, if the assert should be igored.
+ // returns false, if the assert should be ignored.
virtual int doAssert(const char* szFile, int iLine, const char* szExpr) = 0;
virtual void reportFatalError(CorJitResult result) = 0;
//
// SAMPLE_INTERVAL must be >= SIZE. SAMPLE_INTERVAL / SIZE
// gives the average number of calls between table updates.
- //
+ //
struct ClassProfile32
{
- enum {
- SIZE = 8,
- SAMPLE_INTERVAL = 32,
- CLASS_FLAG = 0x80000000,
+ enum
+ {
+ SIZE = 8,
+ SAMPLE_INTERVAL = 32,
+ CLASS_FLAG = 0x80000000,
INTERFACE_FLAG = 0x40000000,
OFFSET_MASK = 0x3FFFFFFF
};
// 3. The JIT may mark a schema item with an alignment flag. This may be used to increase the alignment of a field.
// 4. Each data entry shall be laid out without extra padding.
//
- // The intention here is that it becomes possible to describe a C data structure with the alignment for ease of use with
+ // The intention here is that it becomes possible to describe a C data structure with the alignment for ease of use with
// instrumentation helper functions
virtual JITINTERFACE_HRESULT allocPgoInstrumentationBySchema(
CORINFO_METHOD_HANDLE ftnHnd,
[out] ReJITID * pReJitId);
/*
- * Retrieves informaiton about dynamic methods
+ * Retrieves information about dynamic methods
*
* Certain methods like IL Stubs or LCG do not have
* associated metadata that can be retrieved using the IMetaDataImport APIs.
/*
* Same as Initialize except that the final path name is the path string to
- * name the final location of the pdb file. This is used in build enviroments in
+ * name the final location of the pdb file. This is used in build environments in
* which the pdb is built in a temporary location and moved when the build is
* complete.
*/
struct MSLAYOUT DacpGcHeapDetails
{
- CLRDATA_ADDRESS heapAddr = 0; // Only filled in in server mode, otherwise NULL
+ CLRDATA_ADDRESS heapAddr = 0; // Only filled in server mode, otherwise NULL
CLRDATA_ADDRESS alloc_allocated = 0;
CLRDATA_ADDRESS mark_array = 0;
CLRDATA_ADDRESS mem = 0;
// pass this to request if non-null to get the next segments.
CLRDATA_ADDRESS next = 0;
- CLRDATA_ADDRESS gc_heap = 0; // only filled in in server mode, otherwise NULL
+ CLRDATA_ADDRESS gc_heap = 0; // only filled in server mode, otherwise NULL
// computed field: if this is the ephemeral segment highMark includes the ephemeral generation
CLRDATA_ADDRESS highAllocMark = 0;
struct MSLAYOUT DacpGcHeapAnalyzeData
{
- CLRDATA_ADDRESS heapAddr = 0; // Only filled in in server mode, otherwise NULL
+ CLRDATA_ADDRESS heapAddr = 0; // Only filled in server mode, otherwise NULL
CLRDATA_ADDRESS internal_root_array = 0;
ULONG64 internal_root_array_index = 0;
//
-// structure use to retrieve class layout informaiton
+// structure use to retrieve class layout information
//
typedef struct
{
DWORD *pdwFlags) PURE;
//*****************************************
- // return method implementation informaiton, like RVA and implflags
+ // return method implementation information, like RVA and implflags
//*****************************************
// returned void in v1.0/v1.1
__checkReturn
DWORD *pdwImplFlags) PURE; // [OUT] Impl. Flags
//*****************************************
- // return method implementation informaiton, like RVA and implflags
+ // return method implementation information, like RVA and implflags
//*****************************************
__checkReturn
STDMETHOD(GetFieldRVA)(
#endif
//
-// PDB annotations for the static contract analysis tool. These are seperated
+// PDB annotations for the static contract analysis tool. These are separated
// from Contract.h to allow their inclusion in any part of the system.
//
}
// Ensure that code will not execute if an instruction set is usable. Call only
- // if the instruction set has previously reported as unusable, but when
- // that that status has not yet been recorded to the AOT compiler
+ // if the instruction set has previously reported as unusable, but the status
+ // has not yet been recorded to the AOT compiler.
void compVerifyInstructionSetUnusable(CORINFO_InstructionSet isa)
{
- // use compExactlyDependsOn to capture are record the use of the isa
+ // use compExactlyDependsOn to capture are record the use of the ISA.
bool isaUsable = compExactlyDependsOn(isa);
// Assert that the is unusable. If true, this function should never be called.
assert(!isaUsable);
}
// Answer the question: Is a particular ISA allowed to be used implicitly by optimizations?
- // The result of this api call will match the target machine if the result is true
- // If the result is false, then the target machine may have support for the instruction
+ // The result of this api call will match the target machine if the result is true.
+ // If the result is false, then the target machine may have support for the instruction.
bool compOpportunisticallyDependsOn(CORINFO_InstructionSet isa) const
{
if ((opts.compSupportsISA & (1ULL << isa)) != 0)
// state: the requestor's expected ref count state; defaults to RCS_NORMAL
//
// Notes:
-// It is currently the caller's responsibilty to ensure this increment
+// It is currently the caller's responsibility to ensure this increment
// will not cause overflow.
inline void LclVarDsc::incLvRefCnt(unsigned short delta, RefCountState state)
// state: the requestor's expected ref count state; defaults to RCS_NORMAL
//
// Notes:
-// It is currently the caller's responsibilty to ensure this increment
+// It is currently the caller's responsibility to ensure this increment
// will not cause overflow.
inline void LclVarDsc::incLvRefCntWtd(weight_t delta, RefCountState state)
// By default, we're guaranteed to see at least 30 calls to instrumented method, for dynamic PGO.
// Hence we require at least 30 observed switch executions.
//
- // The profitabilty of peeling is related to the dominant fraction. The cost has a constant portion
+ // The profitability of peeling is related to the dominant fraction. The cost has a constant portion
// (at a minimum the cost of a not-taken branch) and a variable portion, plus increased code size.
// So we don't want to peel in cases where the dominant fraction is too small.
//
assert(genStackPtr->rpdArg);
assert(genStackPtr->rpdArgTypeGet() == rpdARG_PUSH);
- // We only need to report these when we're doing fuly-interruptible
+ // We only need to report these when we're doing fully-interruptible
assert(compiler->codeGen->GetInterruptible());
GCENCODER_WITH_LOGGING(gcInfoEncoderWithLog, gcInfoEncoder);
// Re-walk that list and mark all outgoing arguments that we're marked as live
// earlier, as going dead after the call.
- // We only need to report these when we're doing fuly-interruptible
+ // We only need to report these when we're doing fully-interruptible
assert(compiler->codeGen->GetInterruptible());
GCENCODER_WITH_LOGGING(gcInfoEncoderWithLog, gcInfoEncoder);
*/
GenTree* Compiler::gtWalkOpEffectiveVal(GenTree* op)
{
- for (;;)
+ while (true)
{
op = op->gtEffectiveVal();
op = op2->AsColon()->ElseNode();
}
- // Clear colon flags only if the qmark itself is not conditionaly executed
+ // Clear colon flags only if the qmark itself is not conditionally executed
if ((tree->gtFlags & GTF_COLON_COND) == 0)
{
fgWalkTreePre(&op, gtClearColonCond);
return;
}
- for (;;)
+ while (true)
{
next = list->gtNext;
// });
//
// This function is generally more efficient that the operand iterator and should be preferred over that API for
- // hot code, as it affords better opportunities for inlining and acheives shorter dynamic path lengths when
+ // hot code, as it affords better opportunities for inlining and achieves shorter dynamic path lengths when
// deciding how operands need to be accessed.
//
// Note that this function does not respect `GTF_REVERSE_OPS`. This is always safe in LIR, but may be dangerous
inline GenTree* GenTree::gtEffectiveVal(bool commaOnly /* = false */)
{
GenTree* effectiveVal = this;
- for (;;)
+ while (true)
{
if (effectiveVal->gtOper == GT_COMMA)
{
// Sets GTF_CALL_M_PINVOKE on the call for pinvokes.
//
// Also sets GTF_CALL_UNMANAGED on call for inline pinvokes if the
-// call passes a combination of legality and profitabilty checks.
+// call passes a combination of legality and profitability checks.
//
// If GTF_CALL_UNMANAGED is set, increments info.compUnmanagedCallCountWithGCTransition
case NI_AVX_InsertVector128:
case NI_AVX2_InsertVector128:
{
- // InsertVector128 is special in that that it returns a TYP_SIMD32 but takes a TYP_SIMD16
+ // InsertVector128 is special in that it returns a TYP_SIMD32 but takes a TYP_SIMD16.
assert(!supportsSIMDScalarLoads);
const unsigned expectedSize = 16;
//
// Arguments:
// block - The block for which we're selecting a predecesor.
-// prevBlock - The previous block in in allocation order.
+// prevBlock - The previous block in allocation order.
// pPredBlockIsAllocated - A debug-only argument that indicates whether any of the predecessors have been seen
// in allocation order.
//
//
bool LinearScan::IsResolutionNode(LIR::Range& containingRange, GenTree* node)
{
- for (;;)
+ while (true)
{
if (IsResolutionMove(node))
{
// tree nodes are consumed.
// - In LSRA_DUMP_REFPOS, which is after the intervals are built, but before
// register allocation, each node is dumped, along with all of the RefPositions,
- // The Intervals are identifed as Lnnn for lclVar intervals, Innn for for other
+ // The Intervals are identifed as Lnnn for lclVar intervals, Innn for other
// intervals, and Tnnn for internal temps.
// - In LSRA_DUMP_POST, which is after register allocation, the registers are
// shown.
// Used by RefTypeDef/Use positions of a multi-reg call node.
// Indicates the position of the register that this ref position refers to.
// The max bits needed is based on max value of MAX_RET_REG_COUNT value
- // across all targets and that happens 4 on on Arm. Hence index value
+ // across all targets and that happened to be 4 on Arm. Hence index value
// would be 0..MAX_RET_REG_COUNT-1.
unsigned char multiRegIdx : 2;
}
//------------------------------------------------------------------------
-// BuildNode: Build the RefPositions for for a node
+// BuildNode: Build the RefPositions for a node
//
// Arguments:
// treeNode - the node of interest
#include "lower.h"
//------------------------------------------------------------------------
-// BuildNode: Build the RefPositions for for a node
+// BuildNode: Build the RefPositions for a node
//
// Arguments:
// treeNode - the node of interest
#include "lower.h"
//------------------------------------------------------------------------
-// BuildNode: Build the RefPositions for for a node
+// BuildNode: Build the RefPositions for a node
//
// Arguments:
// treeNode - the node of interest
#include "lower.h"
//------------------------------------------------------------------------
-// BuildNode: Build the RefPositions for for a node
+// BuildNode: Build the RefPositions for a node
//
// Arguments:
// treeNode - the node of interest
// For GT_MKREFANY, typically the actual struct copying does
// not have any side-effects and can be delayed. So instead
// of using a temp for the whole struct, we can just use a temp
- // for operand that that has a side-effect
+ // for operand that has a side-effect.
GenTree* operand;
if ((argx->AsOp()->gtOp2->gtFlags & GTF_ALL_EFFECT) == 0)
{
//------------------------------------------------------------------------
// TrySpecialCases: check special cases that require special transformations.
-// We don't have any for for init block.
+// We don't have any for init block.
//
void MorphInitBlockHelper::TrySpecialCases()
{
}
// At the end of the merge store results of the dataflow equations, in a postmerge state.
- // We also handle the case where calls conditionally kill CSE availabilty.
+ // We also handle the case where calls conditionally kill CSE availability.
//
bool EndMerge(BasicBlock* block)
{
// If it is 'true' then the initial value of m_preMergeOut was different than the final value that
// we computed for bbCseOut. When it is true we will visit every the successor of 'block'
//
- // This is also why we need to allocate an extra bit in our cseLivenessTrair BitVecs.
- // We always need to visit our successor blocks once, thus we require that that the first time
- // that we visit a block we have a bit set in m_preMergeOut that won't be set when we compute
+ // This is also why we need to allocate an extra bit in our cseLivenessTraits BitVecs.
+ // We always need to visit our successor blocks once, thus we require that the first time
+ // we visit a block we have a bit set in m_preMergeOut that won't be set when we compute
// the new value of bbCseOut.
//
bool notDone = !BitVecOps::Equal(m_comp->cseLivenessTraits, block->bbCseOut, m_preMergeOut);
// The enregCount only tracks the uses of integer registers
//
- // We could track floating point register usage seperately
+ // We could track floating point register usage separately
// but it isn't worth the additional complexity as floating point CSEs
// are rare and we typically have plenty of floating point register available.
//
a) TYP_UNKNOWN means 'baseType' of SIMD vector which is not known apriori
b) Each method maps to a unique intrinsic Id
c) To facilitate argument types to be used as an array initializer, args are listed within "{}" braces.
- d) Since comma is used as actual param seperator in a macro, TYP_UNDEF entries are added to keep param count constant.
+ d) Since comma is used as actual param separator in a macro, TYP_UNDEF entries are added to keep param count constant.
e) TODO-Cleanup: when we plumb TYP_SIMD through front-end, replace TYP_STRUCT with TYP_SIMD.
*/
//
// Resolving collisions using a bucket chain avoids the primary clustering
// issue common in linearly-probed open addressed hash tables, while using
-// buckets as chain nodes avoids the allocaiton traffic typical of chained
+// buckets as chain nodes avoids the allocation traffic typical of chained
// tables. Applying the hopscotch algorithm in the aforementioned paper
// could further improve performance by optimizing access patterns for
// better cache usage.
// In addition to classical numbering, this implementation also performs disambiguation of heap writes,
// using memory SSA and the following aliasing model:
//
-// 1. Arrays of different types do not alias - taking into account the array compatibilty rules, i. e.
+// 1. Arrays of different types do not alias - taking into account the array compatibility rules, i. e.
// "int[] <-> uint[]" and such being allowed.
// 2. Different static fields do not alias (meaning mutable overlapping RVA statics are not supported).
// 3. Different class fields do not alias. Struct fields are allowed to alias - this supports code that
}
// In the case of global function, we have tkParent as m_tdModule.
- // We will always do the optmization.
+ // We will always do the optimization.
if (TypeFromToken(tkParent) == mdtTypeRef)
{
// If we're preserving local typerefs, skip this token
int iLast;
int nResult;
- for (;;)
+ while (true)
{
// if less than two elements you're done.
if (iLeft >= iRight)
m_bPreSaveDone = true;
- // send the Ref->Def optmization notification to host
+ // send the Ref->Def optimization notification to host
if (m_pHandler != NULL)
{
TOKENMAP * ptkmap = GetMemberRefToMemberDefMap();
ridEnd = ridBegin + 1;
// Search back to start of group.
- for (;;)
+ while (true)
{
if (ridBegin <= 1)
{
// If desired, search forward to end of group.
if (pRidEnd != NULL)
{
- for (;;)
+ while (true)
{
if (ridEnd > GetCountRecs(ixTbl))
{
HRESULT hr;
int iLast;
- for (;;)
+ while (true)
{
// if less than two elements you're done.
if (iLeft >= iRight)
mdMethodDef mb); // The method for which to get props.
//*****************************************
- // return method implementation informaiton, like RVA and implflags
+ // return method implementation information, like RVA and implflags
//*****************************************
__checkReturn
STDMETHODIMP GetMethodImplProps(
// The code in MD\DataSource\TargetTypes.* takes a direct dependency on
// the layouts of types in MD. This is used by the debugger to read metadata
-// from a seperate process by deserializing the memory for these datastructures.
+// from a separate process by deserializing the memory for these datastructures.
//
// You are probably reading this comment because you changed a layout and
// one of the static_asserts failed during build. This is what you should
mdMethodDef mb); // The method for which to get props.
//*****************************************
- // return method implementation informaiton, like RVA and implflags
+ // return method implementation information, like RVA and implflags
//*****************************************
__checkReturn
STDMETHODIMP GetMethodImplProps(
}
}
- // Allocate new multidimensional array of given dimensions. Assumes that that pLengths is immutable.
+ // Allocate new multidimensional array of given dimensions. Assumes that pLengths is immutable.
internal static unsafe Array NewMultiDimArray(EETypePtr eeType, int* pLengths, int rank)
{
Debug.Assert(eeType.IsArray && !eeType.IsSzArray);
{
// X86 needs to pass callee pop information to the return value thunks, so, since it
// only has 2 argument registers and may/may not need to return 8 bytes of data, put the return
- // data in a seperate thread local store passed in the other available register (edx)
+ // data in a separate thread local store passed in the other available register (edx)
fixed (ReturnBlock* actualReturnDataStructAddress = &t_NonArgRegisterReturnSpace)
{
}
/// <summary>
- /// Does a method actually recieve a VTable slot. (Must not be called for interface methods)
+ /// Does a method actually receive a VTable slot. (Must not be called for interface methods)
/// </summary>
/// <param name="method"></param>
/// <returns></returns>
#define HAS_THISPTR_RETBUF_PRECODE 1
#define CODE_SIZE_ALIGN 16 // must alloc code blocks on 8-byte boundaries; for perf reasons we use 16 byte boundaries
-#define CACHE_LINE_SIZE 64 // Current AMD64 processors have 64-byte cache lines as per AMD64 optmization manual
+#define CACHE_LINE_SIZE 64 // Current AMD64 processors have 64-byte cache lines as per AMD64 optimization manual
#define LOG2SLOT LOG2_PTRSIZE
#define ENREGISTERED_RETURNTYPE_MAXSIZE 8 // bytes
return *(DWORD*)pSpillSlot;
}
-inline
+inline
ARG_SLOT FPSpillToR8(void* pSpillSlot)
{
LIMITED_METHOD_CONTRACT;
// Exception handling
//**********************************************************************
-inline PCODE GetIP(const CONTEXT * context)
+inline PCODE GetIP(const CONTEXT * context)
{
CONTRACTL
{
return PCODE(context->Rip);
}
-inline void SetIP(CONTEXT* context, PCODE rip)
+inline void SetIP(CONTEXT* context, PCODE rip)
{
CONTRACTL
{
NOTHROW;
GC_NOTRIGGER;
SUPPORTS_DAC;
-
+
PRECONDITION(CheckPointer(context));
}
CONTRACTL_END;
return (TADDR)context->Rsp;
}
-inline void SetSP(CONTEXT *context, TADDR rsp)
+inline void SetSP(CONTEXT *context, TADDR rsp)
{
CONTRACTL
{
NOTHROW;
GC_NOTRIGGER;
SUPPORTS_DAC;
-
+
PRECONDITION(CheckPointer(context));
}
CONTRACTL_END;
struct ComToManagedExRecord; // defined in cgencpu.cpp
-inline BOOL IsUnmanagedValueTypeReturnedByRef(UINT sizeofvaluetype)
+inline BOOL IsUnmanagedValueTypeReturnedByRef(UINT sizeofvaluetype)
{
LIMITED_METHOD_CONTRACT;
BYTE m_padding[4];
BYTE m_movR10[2]; // MOV R10,
LPVOID m_uet; // pointer to start of this structure
- BYTE m_movRAX[2]; // MOV RAX,
+ BYTE m_movRAX[2]; // MOV RAX,
DECLSPEC_ALIGN(8)
const BYTE* m_execstub; // pointer to destination code // ensure this is qword aligned
BYTE m_jmpRAX[3]; // JMP RAX
LIMITED_METHOD_CONTRACT;
return offsetof(UMEntryThunkCode, m_movR10);
- }
+ }
};
#include <poppack.h>
// ClrFlushInstructionCache is used when we want to call FlushInstructionCache
// for a specific architecture in the common code, but not for other architectures.
-// We call ClrFlushInstructionCache whenever we create or modify code in the heap.
+// We call ClrFlushInstructionCache whenever we create or modify code in the heap.
// Currently ClrFlushInstructionCache has no effect on AMD64
//
EXTERN _GenericPInvokeCalliStubWorker@12:PROC
; To debug that LastThrownObjectException really is EXCEPTION_COMPLUS
-ifdef TRACK_CXX_EXCEPTION_CODE_HACK
+ifdef TRACK_CXX_EXCEPTION_CODE_HACK
EXTERN __imp____CxxFrameHandler:PROC
endif
PUSH_CPFH_FOR_COM macro trashReg, pFrameBaseReg, pFrameOffset
;
- ; Setup the FrameHandlerExRecord
+ ; Setup the FrameHandlerExRecord
;
push dword ptr [pFrameBaseReg + pFrameOffset]
push _COMPlusFrameHandlerRevCom
;Incoming:
; ESP+4: Pointer to buffer to which FPU state should be saved
_CaptureFPUContext@4 PROC public
-
+
mov ecx, [esp+4]
fnstenv [ecx]
retn 4
; Incoming:
; ESP+4: Pointer to buffer from which FPU state should be restored
_RestoreFPUContext@4 PROC public
-
+
mov ecx, [esp+4]
fldenv [ecx]
retn 4
mov edx, [esp + 0ch] ; grab the first argument
mov edx, [edx] ; grab the SEH exception code
-
+
mov dword ptr [eax + Thread_m_LastCxxSEHExceptionCode], edx
-Chain:
+Chain:
pop edx
; [esp] contains the value of EAX we must restore. We would like
; [esp] to contain the address of the real imported CxxFrameHandler
; so we can chain to it.
-
+
mov eax, [__imp____CxxFrameHandler]
mov eax, [eax]
xchg [esp], eax
-
+
ret
-
+
___CxxFrameHandler3 ENDP
endif ; _DEBUG
endif ; FEATURE_CORECLR
_ResumeAtJitEHHelper@4 PROC public
mov edx, [esp+4] ; edx = pContext (EHContext*)
-
+
mov ebx, [edx+EHContext_Ebx]
mov esi, [edx+EHContext_Esi]
mov edi, [edx+EHContext_Edi]
- mov ebp, [edx+EHContext_Ebp]
+ mov ebp, [edx+EHContext_Ebp]
mov ecx, [edx+EHContext_Esp]
mov eax, [edx+EHContext_Eip]
mov [ecx-4], eax
mov [ecx-10h], eax
lea esp, [ecx-10h]
pop edx
- pop ecx
- pop eax
+ pop ecx
+ pop eax
ret
_ResumeAtJitEHHelper@4 ENDP
nop ; Indicate that it is OK to call managed code directly from here
endif
- ; Reflect the changes to the context and only update non-volatile registers.
+ ; Reflect the changes to the context and only update non-volatile registers.
; This will be used later to update REGDISPLAY
- mov edx, [esp+12+12]
+ mov edx, [esp+12+12]
mov [edx+EHContext_Ebx], ebx
mov [edx+EHContext_Esi], esi
mov [edx+EHContext_Edi], edi
mov [edx+EHContext_Ebp], ebp
-
+
pop edi
pop esi
pop ebx
push ecx
popfd ; Save the updated flags.
pushfd
- pop ecx ; Retrive the updated flags
+ pop ecx ; Retrieve the updated flags
xor ecx, eax ; Test if it actually changed (bit set means yes)
push eax
popfd ; Restore the flags
push ecx
popfd ; Save the updated flags.
pushfd
- pop ecx ; Retrive the updated flags
+ pop ecx ; Retrieve the updated flags
xor ecx, eax ; Test if it actually changed (bit set means yes)
push eax
popfd ; Restore the flags
pop edi
pop esi
pop edx
-
+
; jump back up to the epilog
jmp complete
; Jump to callsite
jmp eax
-
+
; This will never be executed. It is just to help out stack-walking logic
; which disassembles the epilog to unwind the stack.
ret
; void __stdcall JIT_EndCatch();
JIT_EndCatch PROC stdcall public
- ; make temp storage for return address, and push the address of that
- ; as the last arg to COMPlusEndCatch
+ ; make temp storage for return address, and push the address of that
+ ; as the last arg to COMPlusEndCatch
mov ecx, [esp]
push ecx;
push esp;
push ebx
push ebp
- call _COMPlusEndCatch@20 ; returns old esp value in eax, stores jump address
+ call _COMPlusEndCatch@20 ; returns old esp value in eax, stores jump address
; now eax = new esp, [esp] = new eip
pop edx ; edx = new eip
_CRemotingServices__DispatchInterfaceCall@0 proc public
; push MethodDesc* passed in eax by precode and forward to the worker
push eax
-
+
; NOTE: At this point the stack looks like
;
; esp---> saved MethodDesc of Interface method
push ebp ; Methods are always EBP framed
add [esp], 8 ; Skip past the return IP, straight to the stack args that were passed to our caller
; Skip past saved EBP value: 4 bytes
- ; - plus return address from caller's caller: 4 bytes
+ ; - plus return address from caller's caller: 4 bytes
;
- ; Assuming Foo() calls Bar(), and Bar() calls ProfileEnterNake() as illustrated (stack
- ; grows up). We want to get what Foo() passed on the stack to Bar(), so we need to pass
+ ; Assuming Foo() calls Bar(), and Bar() calls ProfileEnterNake() as illustrated (stack
+ ; grows up). We want to get what Foo() passed on the stack to Bar(), so we need to pass
; the return address from caller's caller which is Foo() in this example.
;
; ProfileEnterNaked()
mov edx, esp ; the address of the Platform structure
mov ecx, [esp+52]; The functionIDOrClientID parameter that was pushed to FunctionEnter
; Skip past ProfilePlatformSpecificData we pushed: 40 bytes
- ; - plus saved edi, esi : 8 bytes
- ; - plus return address from caller: 4 bytes
+ ; - plus saved edi, esi : 8 bytes
+ ; - plus return address from caller: 4 bytes
call @ProfileEnter@8
push ebp ; Methods are always EBP framed
add [esp], 8 ; Skip past the return IP, straight to the stack args that were passed to our caller
; Skip past saved EBP value: 4 bytes
- ; - plus return address from caller's caller: 4 bytes
+ ; - plus return address from caller's caller: 4 bytes
;
- ; Assuming Foo() calls Bar(), and Bar() calls ProfileEnterNake() as illustrated (stack
- ; grows up). We want to get what Foo() passed on the stack to Bar(), so we need to pass
+ ; Assuming Foo() calls Bar(), and Bar() calls ProfileEnterNake() as illustrated (stack
+ ; grows up). We want to get what Foo() passed on the stack to Bar(), so we need to pass
; the return address from caller's caller which is Foo() in this example.
;
; ProfileEnterNaked()
push eax ; -- struct eax field
; Check if we need to save off any floating point registers
- fstsw ax
+ fstsw ax
and ax, 3800h ; Check the top-of-fp-stack bits
cmp ax, 0 ; If non-zero, we have something to save
jnz SaveFPReg
SaveFPReg:
push 1 ; mark that a float value is present -- struct floatingPointValuePresent field
- sub esp, 4 ; Make room for the FP value
+ sub esp, 4 ; Make room for the FP value
fst dword ptr [esp] ; Copy the FP value to the buffer as a float -- struct floatBuffer field
sub esp, 8 ; Make room for the FP value
fstp qword ptr [esp] ; Copy FP values to the buffer as a double -- struct doubleBuffer1 and doubleBuffer2 fields
mov edx, esp ; the address of the Platform structure
mov ecx, [esp+52]; The clientData that was pushed to FunctionEnter
; Skip past ProfilePlatformSpecificData we pushed: 40 bytes
- ; - plus saved edx, ecx : 8 bytes
- ; - plus return address from caller: 4 bytes
+ ; - plus saved edx, ecx : 8 bytes
+ ; - plus return address from caller: 4 bytes
call @ProfileLeave@8
push ebp ; Methods are always EBP framed
add [esp], 8 ; Skip past the return IP, straight to the stack args that were passed to our caller
; Skip past saved EBP value: 4 bytes
- ; - plus return address from caller's caller: 4 bytes
+ ; - plus return address from caller's caller: 4 bytes
;
- ; Assuming Foo() calls Bar(), and Bar() calls ProfileEnterNake() as illustrated (stack
- ; grows up). We want to get what Foo() passed on the stack to Bar(), so we need to pass
+ ; Assuming Foo() calls Bar(), and Bar() calls ProfileEnterNake() as illustrated (stack
+ ; grows up). We want to get what Foo() passed on the stack to Bar(), so we need to pass
; the return address from caller's caller which is Foo() in this example.
;
; ProfileEnterNaked()
mov edx, esp ; the address of the Platform structure
mov ecx, [esp+52]; The clientData that was pushed to FunctionEnter
; Skip past ProfilePlatformSpecificData we pushed: 40 bytes
- ; - plus saved edx, ecx : 8 bytes
- ; - plus return address from caller: 4 bytes
+ ; - plus saved edx, ecx : 8 bytes
+ ; - plus return address from caller: 4 bytes
call @ProfileTailcall@8
; EAX - the NDirectMethodDesc
; ECX - may be return buffer address
; [ESP + 4] - the VASigCookie
-;
+;
_VarargPInvokeStub@0 proc public
; EDX <- VASigCookie
mov edx, [esp + 4] ; skip retaddr
mov edx, [edx + VASigCookie__StubOffset]
test edx, edx
-
+
jz GoCallVarargWorker
; ---------------------------------------
-
+
; EAX contains MD ptr for the IL stub
jmp edx
-
+
GoCallVarargWorker:
;
; MD ptr in EAX, VASigCookie ptr at [esp+4]
;
-
+
STUB_PROLOG
mov esi, esp
; restore pMD
pop eax
-
+
STUB_EPILOG
; jump back to the helper - this time it won't come back here as the stub already exists
; EAX - the unmanaged target
; ECX, EDX - arguments
; [ESP + 4] - the VASigCookie
-;
+;
_GenericPInvokeCalliHelper@0 proc public
; save the target
push eax
mov eax, [eax + VASigCookie__StubOffset]
test eax, eax
-
+
jz GoCallCalliWorker
; ---------------------------------------
-
+
push eax
; stack layout at this point:
; +----------------------+
; | stub entry point | ESP + 0
; ------------------------
-
+
; remove VASigCookie from the stack
mov eax, [esp + 8]
mov [esp + 12], eax
-
+
; move stub entry point below the RA
mov eax, [esp]
mov [esp + 8], eax
; load EAX with the target address
pop eax
pop eax
-
+
; stack layout at this point:
;
; | ... |
; CALLI target address is in EAX
ret
-
+
GoCallCalliWorker:
; the target is on the stack and will become m_Datum of PInvokeCalliFrame
; call the stub generating worker
;
; target ptr in EAX, VASigCookie ptr in EDX
;
-
+
STUB_PROLOG
mov esi, esp
; restore target
pop eax
-
+
STUB_EPILOG
; jump back to the helper - this time it won't come back here as the stub already exists
; actual imbalance check is implemented.
; [ESP + 4] - the StackImbalanceCookie
; [EBP + 8] - stack arguments (EBP frame pushed by the calling stub)
-;
+;
_PInvokeStackImbalanceHelper@0 proc public
; StackImbalanceCookie to EBX
push ebx
lea ebx, [esp + 8]
-
+
push esi
push edi
-
+
; copy stack args
mov edx, ecx
mov ecx, [ebx + StackImbalanceCookie__m_dwStackArgSize]
cld
rep movsd
-
+
; record pre-call ESP
mov [ebx + StackImbalanceCookie__m_dwSavedEsp], esp
-
+
; call the target (restore ECX in case it's a thiscall)
mov ecx, edx
call [ebx + StackImbalanceCookie__m_pTarget]
push eax
push edx
sub esp, 12
-
+
.errnz (StackImbalanceCookie__HAS_FP_RETURN_VALUE AND 00ffffffh), HAS_FP_RETURN_VALUE has changed - update asm code
-
+
; save top of the floating point stack if the target has FP retval
test byte ptr [ebx + StackImbalanceCookie__m_callConv + 3], (StackImbalanceCookie__HAS_FP_RETURN_VALUE SHR 24)
jz noFPURetVal
pop esi
pop ebx
-
+
; EBP frame and original stack arguments will be removed by the caller
ret
_PInvokeStackImbalanceHelper@0 endp
; This is a fast alternative to CallDescr* tailored specifically for
; COM to CLR calls. Stack arguments don't come in a continuous buffer
; and secret argument can be passed in EAX.
-;
+;
; extern "C" ARG_SLOT __fastcall COMToCLRDispatchHelper(
; INT_PTR dwArgECX, ; ecx
; ecx: dwArgECX
; edx: dwArgEDX
- offset_pTarget equ 4
- offset_pSecretArg equ 8
- offset_pInputStack equ 0Ch
+ offset_pTarget equ 4
+ offset_pSecretArg equ 8
+ offset_pInputStack equ 0Ch
offset_wOutputStackSlots equ 10h
- offset_pOutputStackOffsets equ 14h
+ offset_pOutputStackOffsets equ 14h
offset_pCurFrame equ 18h
movzx eax, word ptr [esp + offset_wOutputStackSlots]
jnz CopyStackArgs
; There are no stack args to copy and ECX and EDX are already setup
- ; with the correct arguments for the callee, so we just have to
+ ; with the correct arguments for the callee, so we just have to
; push the CPFH and make the call.
PUSH_CPFH_FOR_COM eax, esp, offset_pCurFrame ; trashes eax
_CopyCtorCallStub@0 proc public
; there may be an argument in ecx - save it
push ecx
-
+
; push pointer to arguments
lea edx, [esp + 8]
push edx
-
+
call _CopyCtorCallStubWorker@4
; restore ecx and tail call to the target
push esi ; pTransitionBlock
call _StubDispatchFixupWorker@16
-
+
STUB_EPILOG
_StubDispatchFixupPatchLabel@0:
; NULL (it throws an exception if stub creation fails.)
; From here on, mustn't trash eax
-
+
STUB_EPILOG
_ExternalMethodFixupPatchLabel@0:
public _ExternalMethodFixupPatchLabel@0
; Tailcall target
- jmp eax
+ jmp eax
; This will never be executed. It is just to help out stack-walking logic
; which disassembles the epilog to unwind the stack.
; NULL (it throws an exception if stub creation fails.)
; From here on, mustn't trash eax
-
+
STUB_EPILOG
; Share the patch label
; The call in softbound vtable slots initially points to this function.
; The pupose of this function is to transfer the control to right target and
; to optionally patch the target of the jump so that we do not take this slow path again.
-;
+;
_VirtualMethodFixupStub@0 proc public
pop eax ; Pop the return address. It points right after the call instruction in the thunk.
; Preserve argument registers
push ecx
push edx
-
+
push eax ; address of the thunk
push ecx ; this ptr
call _VirtualMethodFixupWorker@8
mov esi, esp
- ; EAX contains MethodDesc* from the precode. Push it here as argument
- ; for PreStubWorker
+ ; EAX contains MethodDesc* from the precode. Push it here as argument
+ ; for PreStubWorker
push eax
-
+
push esi
call _PreStubWorker@8
; NULL (it throws an exception if stub creation fails.)
; From here on, mustn't trash eax
-
+
STUB_EPILOG
-
+
; Tailcall target
jmp eax
-
+
; This will never be executed. It is just to help out stack-walking logic
; which disassembles the epilog to unwind the stack.
ret
; Get pComPlusCallInfo for return thunk
mov ecx, [ebx + ComPlusCallMethodDesc__m_pComPlusCallInfo]
-
+
STUB_EPILOG_RETURN
-
+
; Tailcall return thunk
jmp [ecx + ComPlusCallInfo__m_pRetThunk]
-
+
; This will never be executed. It is just to help out stack-walking logic
; which disassembles the epilog to unwind the stack.
ret
; From here on, mustn't trash eax:edx
mov ecx, ebx ; cbStackPop
-
+
mov ebx, [esp+6*4] ; get retaddr
mov [esp+6*4+ecx], ebx ; put it where it belongs
ifdef FEATURE_COMINTEROP
;--------------------------------------------------------------------------
-; This is the code that all com call method stubs run initially.
+; This is the code that all com call method stubs run initially.
; Most of the real work occurs in ComStubWorker(), a C++ routine.
; The template only does the part that absolutely has to be in assembly
; language.
lea edi, [esp]
lea esi, [esp+3*4]
-
+
push edi ; pErrorReturn
push esi ; pFrame
call _ComPreStubWorker@8
nostub:
- ; Even though the ComPreStubWorker sets a 64 bit value as the error return code.
- ; Only the lower 32 bits contain usefula data. The reason for this is that the
+ ; Even though the ComPreStubWorker sets a 64 bit value as the error return code.
+ ; Only the lower 32 bits contain usefula data. The reason for this is that the
; possible error return types are: failure HRESULT, 0 and floating point 0.
- ; In each case, the data fits in 32 bits. Instead, we use the upper half of
+ ; In each case, the data fits in 32 bits. Instead, we use the upper half of
; the return value to store number of bytes to pop
mov eax, [edi]
mov edx, [edi+4]
add esp, edx ; pop bytes of the stack
push ecx ; return address
- ; We need to deal with the case where the method is PreserveSig=true and has an 8
+ ; We need to deal with the case where the method is PreserveSig=true and has an 8
; byte return type. There are 2 types of 8 byte return types: integer and floating point.
; For integer 8 byte return types, we always return 0 in case of failure. For floating
; point return types, we return the value in the floating point register. In both cases
push ecx ; module
push edx ; section index
- push eax ; indirection cell address.
+ push eax ; indirection cell address.
push esi ; pTransitionBlock
call _DynamicHelperWorker@20
foreach (TypeEntryToRegister typeEntry in registrationData.TypesToRegister)
{
- // Keep track of registered type handles so that that we can rollback the registration on exception
+ // Keep track of registered type handles so that we can rollback the registration on exception.
registeredTypes[registeredTypesCount++] = typeEntry;
// Information tracked in these dictionaries is (partially) redundant with information tracked by MRT.
{
Debug.Assert(methodEntry._methodDictionary != IntPtr.Zero);
- // Keep track of registered method dictionaries so that that we can rollback the registration on exception
+ // Keep track of registered method dictionaries so that we can rollback the registration on exception
registeredMethods[registeredMethodsCount++] = methodEntry;
// Register method dictionary -> components mapping first so that we can use it during rollback below
#endif
{
Environment.FailFast(
- "Failed to locate statics table entry for for field '" +
+ "Failed to locate statics table entry for field '" +
fieldName +
"' on type " +
type.ToString());
// This check looks for unboxing and instantiating stubs generated via the compiler backend
if (TypeLoaderEnvironment.TryGetTargetOfUnboxingAndInstantiatingStub(exactTarget, out fatFunctionPointerTarget))
{
- // If this is an unboxing and instantiating stub, use seperate table, find target, and create fat function pointer
+ // If this is an unboxing and instantiating stub, use separate table, find target, and create fat function pointer
exactTarget = FunctionPointerOps.GetGenericMethodFunctionPointer(fatFunctionPointerTarget,
declaringType.ToIntPtr());
}
}
/// <summary>
- /// Setter for RuntimeTypeHandle. Seperate from normal property as all uses should be done with great care.
+ /// Setter for RuntimeTypeHandle. Separate from normal property as all uses should be done with great care.
/// Must not be set with partially constructed type handles
/// </summary>
public void SetRuntimeTypeHandleUnsafe(RuntimeTypeHandle runtimeTypeHandle)
const WCHAR undefMsg[] = W("Undefined resource string ID:0x");
wcscpy_s(szBuffer, iMax, undefMsg);
- // Compute if there is enough space for the message and ID
+ // Compute if there is enough space for the message and ID.
WCHAR* nxt = NULL;
int extraSpace = iMax - (ARRAY_SIZE(undefMsg) - 1);
if (0 < extraSpace)
}
else
{
- // The only possible failure is that that string didn't fit the buffer. So the buffer contains
- // partial string terminated by '\0'
+ // The only possible failure is that the string didn't fit the buffer. So the buffer contains
+ // partial string terminated by '\0'.
// We could return ERROR_INSUFFICIENT_BUFFER, but we'll error on the side of caution here and
- // actually show something (given that this is likely a scenario involving a bug/deployment issue)
+ // actually show something (given that this is likely a scenario involving a bug/deployment issue).
len = iMax - 1;
}
}
If you want to add a PAL_ wrapper function to a native function in
here, you also need to edit palinternal.h and win32pal.h.
-
-
--*/
#ifndef __PAL_H__
//
// If the context record is used as an input parameter, then for each
// portion of the context record controlled by a flag whose value is
-// set, it is assumed that that portion of the context record contains
+// set, it is assumed that such portion of the context record contains
// valid context. If the context record is being used to modify a threads
// context, then only that portion of the threads context is modified.
//
//
// If the context record is used as an input parameter, then for each
// portion of the context record controlled by a flag whose value is
-// set, it is assumed that that portion of the context record contains
+// set, it is assumed that such portion of the context record contains
// valid context. If the context record is being used to modify a threads
// context, then only that portion of the threads context is modified.
//
//
// If the context record is used as an input parameter, then for each
// portion of the context record controlled by a flag whose value is
-// set, it is assumed that that portion of the context record contains
+// set, it is assumed that such portion of the context record contains
// valid context. If the context record is being used to modify a threads
// context, then only that portion of the threads context is modified.
//
//
// If the context record is used as an input parameter, then for each
// portion of the context record controlled by a flag whose value is
-// set, it is assumed that that portion of the context record contains
+// set, it is assumed that such portion of the context record contains
// valid context. If the context record is being used to modify a threads
// context, then only that portion of the threads context is modified.
//
/*++
-
-
Module Name:
filecrt.cpp
Implementation of the file functions in the C runtime library that
are Windows specific.
-
-
--*/
#include "pal/thread.hpp"
}
else /* the only file object with no unix_filename is a pipe */
{
- /* check if the file pipe descrptor is for read or write */
+ /* check if the file pipe descriptor is for read or write */
if (pLocalData->open_flags == O_WRONLY)
{
ERROR( "Couldn't open a write pipe on read mode\n");
Function:
Internal_ScanfExtractFormatW
-Paramaters:
+Parameters:
Fmt
- format string to parse
- first character must be a '%'
- - paramater gets updated to point to the character after
+ - parameter gets updated to point to the character after
the %<foo> format string
Out
- buffer will contain the %<foo> format string
Function:
Internal_ExtractFormatA
-Paramaters:
+Parameters:
Fmt
- format string to parse
- first character must be a '%'
- - paramater gets updated to point to the character after
+ - parameter gets updated to point to the character after
the %<foo> format string
Out
- buffer will contain the %<foo> format string
Flags
- - paramater will be set with the PRINTF_FORMAT_FLAGS defined above
+ - parameter will be set with the PRINTF_FORMAT_FLAGS defined above
Width
- will contain the width specified by the format string
- -1 if none given
/*++
-
-
Module Name:
file.cpp
Implementation of the file WIN API for the PAL
-
-
--*/
#include "pal/dbgmsg.h"
// check if we are going to truncate the "/" corresponding to the
// root folder (e.g. case of "/Volumes"). If so:
//
- // 1) Set the seperator to point to the NULL terminator of the specified
+ // 1) Set the separator to point to the NULL terminator of the specified
// file/folder name.
//
// 2) Null terminate lpBuffer
Function:
PALInitLock
-Take the initializaiton critical section (init_critsec). necessary to serialize
+Take the initialization critical section (init_critsec). necessary to serialize
TerminateProcess along with PAL_Terminate and PAL_Initialize
(no parameters)
implementation (with some_function)
[side note : for the Win32 PAL, this can be accomplished without touching
- pal.h. In Windows, symbols in in dynamic libraries are resolved at
+ pal.h. In Windows, symbols in dynamic libraries are resolved at
compile time. if an application that uses some_function is only linked to
pal.dll, some_function will be resolved to the version in that DLL,
even if other DLLs in the system provide other implementations. In addition,
Function:
PALInitLock
-Take the initializaiton critical section (init_critsec). necessary to serialize
+Take the initialization critical section (init_critsec). necessary to serialize
TerminateProcess along with PAL_Terminate and PAL_Initialize
(no parameters)
int64_t cacheSizeFromSysctl = 0;
size_t sz = sizeof(cacheSizeFromSysctl);
const bool success = false
- // macOS-arm64: Since macOS 12.0, Apple added ".perflevelX." to determinate cache sizes for efficiency
- // and performance cores separetely. "perflevel0" stands for "performance"
+ // macOS-arm64: Since macOS 12.0, Apple added ".perflevelX." to determinate cache sizes for efficiency
+ // and performance cores separately. "perflevel0" stands for "performance"
|| sysctlbyname("hw.perflevel0.l2cachesize", &cacheSizeFromSysctl, &sz, nullptr, 0) == 0
// macOS-arm64: these report cache sizes for efficiency cores only:
|| sysctlbyname("hw.l3cachesize", &cacheSizeFromSysctl, &sz, nullptr, 0) == 0
}
_TCSNCPY_S(_Dir, _DirSize, _Path, length);
- // Normalize the path seperator
+ // Normalize the path separator
size_t iIndex;
for(iIndex = 0; iIndex < length; iIndex++)
{
/*++
-
-
Module Name:
context.c
Implementation of GetThreadContext/SetThreadContext/DebugBreak.
There are a lot of architecture specifics here.
-
-
--*/
#include "pal/dbgmsg.h"
}
/* How to consider the case when self is different from the current
- thread of its owner process. Machine registers values could be retreived
+ thread of its owner process. Machine registers values could be retrieved
by a ptrace(pid, ...) call or from the "/proc/%pid/reg" file content.
Unfortunately, these two methods only depend on process ID, not on
thread ID. */
}
/* How to consider the case when self is different from the current
- thread of its owner process. Machine registers values could be retreived
+ thread of its owner process. Machine registers values could be retrieved
by a ptrace(pid, ...) call or from the "/proc/%pid/reg" file content.
Unfortunately, these two methods only depend on process ID, not on
thread ID. */
ASSIGN_CONTROL_REGS
#if defined(HOST_ARM)
// WinContext assumes that the least bit of Pc is always 1 (denoting thumb)
- // although the pc value retrived from native context might not have set the least bit.
+ // although the pc value retrieved from native context might not have set the least bit.
// This becomes especially problematic if the context is on the JIT_WRITEBARRIER.
lpContext->Pc |= 0x1;
#endif
CONTEXT_GetThreadContextFromThreadState(StateFlavor, (thread_state_t)&State, lpContext);
}
- if (lpContext->ContextFlags & CONTEXT_ALL_FLOATING & CONTEXT_AREA_MASK)
+ if (lpContext->ContextFlags & CONTEXT_ALL_FLOATING & CONTEXT_AREA_MASK)
{
#if defined(HOST_AMD64)
// The thread_get_state for floating point state can fail for some flavors when the processor is not
# All test will link against these libraries:
# pthread and m are part of the Android C library (bionic),
-# so we don't need to link them seperately
+# so we don't need to link them separately
if(NOT CLR_CMAKE_TARGET_ANDROID)
list(APPEND COMMON_TEST_LIBRARIES pthread)
list(APPEND COMMON_TEST_LIBRARIES m)
**
** Source: test1.c
**
-** Purpose: Run through every possible character. For each time that
+** Purpose: Run through every possible character. For each time that
** isxdigit returns:
** 1, check through a list of the known hex characters to ensure that it
-** is really a hex char. Also, when it returns 0, ensure that that character
+** is really a hex char. Also, when it returns 0, ensure that the character
** isn't a hex character.
**
-**
**==========================================================================*/
-
-
#include <palsuite.h>
** Source: test1.c
**
** Purpose:
-** Test to that wcscat correctly concatanates wide strings, including placing
+** Test to that wcscat correctly concatenates wide strings, including placing
** null pointers.
**
-**
**==========================================================================*/
-
-
#include <palsuite.h>
/*
// The .NET Foundation licenses this file to you under the MIT license.
/*
-Source Code: mainWrapper.c
+Source Code: mainWrapper.c
mainWrapper.c creates Composite Test Case Processes and waits for all processes to get over
int GetParameters( int argc, char **argv)
{
- if( (argc != 5) || ((argc == 1) && !strcmp(argv[1],"/?"))
+ if( (argc != 5) || ((argc == 1) && !strcmp(argv[1],"/?"))
|| !strcmp(argv[1],"/h") || !strcmp(argv[1],"/H"))
{
printf("Main Wrapper PAL -Composite Critical Section Test\n");
printf("Usage:\n");
- printf("\t[PROCESS_COUNT] Greater than or Equal to 1 \n");
- printf("\t[THREAD_COUNT] Greater than or Equal to 1 and Less than or Equal to 64 \n");
+ printf("\t[PROCESS_COUNT] Greater than or Equal to 1 \n");
+ printf("\t[THREAD_COUNT] Greater than or Equal to 1 and Less than or Equal to 64 \n");
printf("\t[REPEAT_COUNT] Greater than or Equal to 1\n");
- printf("\t[RELATION_ID [Greater than or Equal to 1]\n");
+ printf("\t[RELATION_ID [Greater than or Equal to 1]\n");
return -1;
}
USE_PROCESS_COUNT = atoi(argv[1]);
- if( USE_PROCESS_COUNT < 0)
+ if( USE_PROCESS_COUNT < 0)
{
printf("\nPROCESS_COUNT to greater than or equal to 1\n");
return -1;
}
THREAD_COUNT = atoi(argv[2]);
- if( THREAD_COUNT < 1 || THREAD_COUNT > 64)
+ if( THREAD_COUNT < 1 || THREAD_COUNT > 64)
{
printf("\nTHREAD_COUNT to be greater than or equal to 1 or less than or equal to 64\n");
return -1;
}
REPEAT_COUNT = atoi(argv[3]);
- if( REPEAT_COUNT < 1)
+ if( REPEAT_COUNT < 1)
{
printf("\nREPEAT_COUNT to greater than or equal to 1\n");
return -1;
}
RELATION_ID = atoi(argv[4]);
- if( RELATION_ID < 1)
+ if( RELATION_ID < 1)
{
printf("\nMain Process:Invalid RELATION_ID number, Pass greater than 1\n");
return -1;
{
unsigned int i = 0;
HANDLE hProcess[MAXIMUM_WAIT_OBJECTS]; //Array to hold Process handles
- DWORD processReturnCode = 0;
+ DWORD processReturnCode = 0;
int testReturnCode = PASS;
STARTUPINFO si[MAXIMUM_WAIT_OBJECTS];
PROCESS_INFORMATION pi[MAXIMUM_WAIT_OBJECTS];
FILE *hFile; //handle to application results file
char fileName[MAX_PATH]; //file name of the application results file
- struct applicationStatistics appStats;
+ struct applicationStatistics appStats;
DWORD dwStart=0; //to store the tick count
char lpCommandLine[MAX_PATH] = "";
int returnCode = 0;
appStats.repeatCount = REPEAT_COUNT;
appStats.buildNumber = getBuildNumber();
-
+
_snprintf(fileName, MAX_PATH, "main_criticalsection_%d_.txt", RELATION_ID);
hFile = fopen(fileName, "w+");
if(hFile == NULL)
- {
+ {
Fail("Error in opening file to write application results for Critical Section Test, and error code is %d\n", GetLastError());
}
//Start Process Time Capture
-dwStart = GetTickCount();
+dwStart = GetTickCount();
for( i = 0; i < USE_PROCESS_COUNT; i++ )
{
ZeroMemory( lpCommandLine, MAX_PATH );
if ( _snprintf( lpCommandLine, MAX_PATH-1, "criticalsection %d %d %d %d", i, THREAD_COUNT, REPEAT_COUNT, RELATION_ID) < 0 )
{
- Trace ("Error: Insufficient commandline string length for for iteration [%d]\n", i);
+ Trace ("Error: Insufficient commandline string length for iteration [%d]\n", i);
}
-
+
/* Zero the data structure space */
ZeroMemory ( &pi[i], sizeof(pi[i]) );
ZeroMemory ( &si[i], sizeof(si[i]) );
//Printing the Command Line
//Trace("Command Line \t %s \n", lpCommandLine);
-
+
//Create Process
if(!CreateProcess( NULL, /* lpApplicationName*/
lpCommandLine, /* lpCommandLine */
}
- returnCode = WaitForMultipleObjects( USE_PROCESS_COUNT, hProcess, TRUE, INFINITE);
+ returnCode = WaitForMultipleObjects( USE_PROCESS_COUNT, hProcess, TRUE, INFINITE);
if( WAIT_OBJECT_0 != returnCode )
{
Trace("Wait for Object(s) @ Main thread for %d processes returned %d, and GetLastError value is %d\n", USE_PROCESS_COUNT, returnCode, GetLastError());
/* check the exit code from the process */
if( ! GetExitCodeProcess( pi[i].hProcess, &processReturnCode ) )
{
- Trace( "GetExitCodeProcess call failed for iteration %d with error code %u\n",
- i, GetLastError() );
-
+ Trace( "GetExitCodeProcess call failed for iteration %d with error code %u\n",
+ i, GetLastError() );
+
testReturnCode = FAIL;
}
if(processReturnCode == FAIL)
{
- Trace( "Process [%d] failed and returned FAIL\n", i);
+ Trace( "Process [%d] failed and returned FAIL\n", i);
testReturnCode = FAIL;
}
if( testReturnCode == PASS)
{
Trace("Test Passed\n");
-
+
}
else
{
Fail("Test Failed\n");
-
+
}
-
+
//Write Process Result Contents to File
if(hFile!= NULL)
- {
+ {
fprintf(hFile, "%lu,%d,%d,%d,%d,%s\n", appStats.operationTime, appStats.relationId,appStats.processCount, appStats.threadCount, appStats.repeatCount, appStats.buildNumber);
}
// The .NET Foundation licenses this file to you under the MIT license.
/*
-Source Code: mainWrapper.c
+Source Code: mainWrapper.c
mainWrapper.c creates Composite Test Case Processes and waits for all processes to get over
int GetParameters( int argc, char **argv)
{
- if( (argc != 5) || ((argc == 1) && !strcmp(argv[1],"/?"))
+ if( (argc != 5) || ((argc == 1) && !strcmp(argv[1],"/?"))
|| !strcmp(argv[1],"/h") || !strcmp(argv[1],"/H"))
{
printf("PAL -Composite Thread Suspension Test\n");
printf("Usage:\n");
- printf("\t[PROCESS_COUNT] Greater than or Equal to 1 \n");
- printf("\t[WORKER_THREAD_MULTIPLIER_COUNT] Greater than or Equal to 1 and Less than or Equal to %d \n", MAXIMUM_WAIT_OBJECTS);
+ printf("\t[PROCESS_COUNT] Greater than or Equal to 1 \n");
+ printf("\t[WORKER_THREAD_MULTIPLIER_COUNT] Greater than or Equal to 1 and Less than or Equal to %d \n", MAXIMUM_WAIT_OBJECTS);
printf("\t[REPEAT_COUNT] Greater than or Equal to 1\n");
- printf("\t[RELATION_ID [greater than or Equal to 1]\n");
+ printf("\t[RELATION_ID [greater than or Equal to 1]\n");
return -1;
}
// Trace("Args 1 is [%s], Arg 2 is [%s], Arg 3 is [%s]\n", argv[1], argv[2], argv[3]);
-
+
USE_PROCESS_COUNT = atoi(argv[1]);
- if( USE_PROCESS_COUNT < 0)
+ if( USE_PROCESS_COUNT < 0)
{
printf("\nPROCESS_COUNT to greater than or equal to 1\n");
return -1;
}
WORKER_THREAD_MULTIPLIER_COUNT = atoi(argv[2]);
- if( WORKER_THREAD_MULTIPLIER_COUNT < 1 || WORKER_THREAD_MULTIPLIER_COUNT > 64)
+ if( WORKER_THREAD_MULTIPLIER_COUNT < 1 || WORKER_THREAD_MULTIPLIER_COUNT > 64)
{
printf("\nWORKER_THREAD_MULTIPLIER_COUNT to be greater than or equal to 1 or less than or equal to 64\n");
return -1;
}
REPEAT_COUNT = atoi(argv[3]);
- if( REPEAT_COUNT < 1)
+ if( REPEAT_COUNT < 1)
{
printf("\nREPEAT_COUNT to greater than or equal to 1\n");
return -1;
}
RELATION_ID = atoi(argv[4]);
- if( RELATION_ID < 1)
+ if( RELATION_ID < 1)
{
printf("\nRELATION_ID to be greater than or equal to 1\n");
return -1;
}
-
+
return 0;
}
FILE *hFile;
char fileName[MAX_PATH];
- struct applicationStatistics appStats;
+ struct applicationStatistics appStats;
- DWORD dwStart=0;
+ DWORD dwStart=0;
char lpCommandLine[MAX_PATH] = "";
appStats.repeatCount = 0;
-
+
//Start Process Time Capture
-dwStart = GetTickCount();
+dwStart = GetTickCount();
if(GetParameters(argc, argv))
{
}
//Assign Correct Values to the Application Stats Structure
- appStats.relationId=RELATION_ID;
+ appStats.relationId=RELATION_ID;
appStats.processCount = USE_PROCESS_COUNT;
appStats.threadCount = THREAD_COUNT ;
appStats.repeatCount = REPEAT_COUNT;
Trace("WORKER_THREAD_MULTIPLIER_COUNT: %d \n", WORKER_THREAD_MULTIPLIER_COUNT);
Trace("REPEAT_COUNT: %d \n", REPEAT_COUNT);
-
+
_snprintf(fileName, MAX_PATH, "main_threadsuspension_%d_.txt",appStats.relationId);
hFile = fopen(fileName, "w+");
if(hFile == NULL)
- {
+ {
Fail("Error in opening file to write application results for Thread Suspension Test with error code %d \n", GetLastError() );
}
-
+
for( i = 0; i < USE_PROCESS_COUNT; i++ )
ZeroMemory( lpCommandLine, MAX_PATH );
if ( _snprintf( lpCommandLine, MAX_PATH-1, "threadsuspension %d %d %d %d", i, WORKER_THREAD_MULTIPLIER_COUNT, REPEAT_COUNT, RELATION_ID) < 0 )
{
- Trace ("Error: Insufficient commandline string length for for iteration [%d]\n", i);
+ Trace ("Error: Insufficient commandline string length for iteration [%d]\n", i);
}
-
+
/* Zero the data structure space */
ZeroMemory ( &pi[i], sizeof(pi[i]) );
ZeroMemory ( &si[i], sizeof(si[i]) );
//Printing the Command Line
//Trace("Command Line \t %s \n", lpCommandLine);
-
+
//Create Process
if(!CreateProcess( NULL, /* lpApplicationName*/
lpCommandLine, /* lpCommandLine */
))
{
Fail("Process Not created for [%d] and GetLastError value is %d\n", i, GetLastError());
-
+
}
else
{
}
- returnCode = WaitForMultipleObjects( USE_PROCESS_COUNT, hProcess, TRUE, INFINITE);
+ returnCode = WaitForMultipleObjects( USE_PROCESS_COUNT, hProcess, TRUE, INFINITE);
if( WAIT_OBJECT_0 != returnCode )
{
Trace("Wait for Object(s) @ Main thread for %d processes returned %d, and GetLastError value is %d\n", USE_PROCESS_COUNT, returnCode, GetLastError());
/* check the exit code from the process */
if( ! GetExitCodeProcess( pi[i].hProcess, &processReturnCode ) )
{
- Trace( "GetExitCodeProcess call failed for iteration %d with error code %u\n",
- i, GetLastError() );
-
+ Trace( "GetExitCodeProcess call failed for iteration %d with error code %u\n",
+ i, GetLastError() );
+
testReturnCode = FAIL;
}
if(processReturnCode == FAIL)
{
- Trace( "Process [%d] failed and returned FAIL\n", i);
+ Trace( "Process [%d] failed and returned FAIL\n", i);
testReturnCode = FAIL;
}
{
Trace("Test Failed\n");
}
-
+
//Write Process Result Contents to File
if(hFile!= NULL)
- {
+ {
fprintf(hFile, "%lu,%d,%d,%d,%d,%s\n", appStats.operationTime, appStats.relationId, appStats.processCount, appStats.threadCount, appStats.repeatCount, appStats.buildNumber);
}
Trace("Error:%d: fclose failed for file %s\n", GetLastError(), fileName);
}
PAL_Terminate();
-
+
if( testReturnCode == PASS)
{
else
{
return FAIL;
-
- }
-
+
+ }
+
}
// The .NET Foundation licenses this file to you under the MIT license.
/*
-Source Code: mainWrapper.c
+Source Code: mainWrapper.c
mainWrapper.c creates Composite Test Case Processes and waits for all processes to get over
int GetParameters( int argc, char **argv)
{
- if( (argc != 5) || ((argc == 1) && !strcmp(argv[1],"/?"))
+ if( (argc != 5) || ((argc == 1) && !strcmp(argv[1],"/?"))
|| !strcmp(argv[1],"/h") || !strcmp(argv[1],"/H"))
{
printf("PAL -Composite Thread Suspension Test\n");
printf("Usage:\n");
- printf("\t[PROCESS_COUNT] Greater than or Equal to 1 \n");
- printf("\t[WORKER_THREAD_MULTIPLIER_COUNT] Greater than or Equal to 1 and Less than or Equal to %d \n", MAXIMUM_WAIT_OBJECTS);
+ printf("\t[PROCESS_COUNT] Greater than or Equal to 1 \n");
+ printf("\t[WORKER_THREAD_MULTIPLIER_COUNT] Greater than or Equal to 1 and Less than or Equal to %d \n", MAXIMUM_WAIT_OBJECTS);
printf("\t[REPEAT_COUNT] Greater than or Equal to 1\n");
- printf("\t[RELATION_ID [greater than or Equal to 1]\n");
+ printf("\t[RELATION_ID [greater than or Equal to 1]\n");
return -1;
}
// Trace("Args 1 is [%s], Arg 2 is [%s], Arg 3 is [%s]\n", argv[1], argv[2], argv[3]);
-
+
USE_PROCESS_COUNT = atoi(argv[1]);
- if( USE_PROCESS_COUNT < 0)
+ if( USE_PROCESS_COUNT < 0)
{
printf("\nPROCESS_COUNT to greater than or equal to 1\n");
return -1;
}
WORKER_THREAD_MULTIPLIER_COUNT = atoi(argv[2]);
- if( WORKER_THREAD_MULTIPLIER_COUNT < 1 || WORKER_THREAD_MULTIPLIER_COUNT > 64)
+ if( WORKER_THREAD_MULTIPLIER_COUNT < 1 || WORKER_THREAD_MULTIPLIER_COUNT > 64)
{
printf("\nWORKER_THREAD_MULTIPLIER_COUNT to be greater than or equal to 1 or less than or equal to 64\n");
return -1;
}
REPEAT_COUNT = atoi(argv[3]);
- if( REPEAT_COUNT < 1)
+ if( REPEAT_COUNT < 1)
{
printf("\nREPEAT_COUNT to greater than or equal to 1\n");
return -1;
}
RELATION_ID = atoi(argv[4]);
- if( RELATION_ID < 1)
+ if( RELATION_ID < 1)
{
printf("\nRELATION_ID to be greater than or equal to 1\n");
return -1;
}
-
+
return 0;
}
FILE *hFile;
char fileName[MAX_PATH];
- struct applicationStatistics appStats;
+ struct applicationStatistics appStats;
- DWORD dwStart=0;
+ DWORD dwStart=0;
char lpCommandLine[MAX_PATH] = "";
appStats.repeatCount = 0;
-
+
//Start Process Time Capture
-dwStart = GetTickCount();
+dwStart = GetTickCount();
if(GetParameters(argc, argv))
{
}
//Assign Correct Values to the Application Stats Structure
- appStats.relationId=RELATION_ID;
+ appStats.relationId=RELATION_ID;
appStats.processCount = USE_PROCESS_COUNT;
appStats.threadCount = THREAD_COUNT ;
appStats.repeatCount = REPEAT_COUNT;
Trace("WORKER_THREAD_MULTIPLIER_COUNT: %d \n", WORKER_THREAD_MULTIPLIER_COUNT);
Trace("REPEAT_COUNT: %d \n", REPEAT_COUNT);
-
+
_snprintf(fileName, MAX_PATH, "main_threadsuspension_%d_.txt",appStats.relationId);
hFile = fopen(fileName, "w+");
if(hFile == NULL)
- {
+ {
Fail("Error in opening file to write application results for Thread Suspension Test with error code %d \n", GetLastError() );
}
-
+
for( i = 0; i < USE_PROCESS_COUNT; i++ )
ZeroMemory( lpCommandLine, MAX_PATH );
if ( _snprintf( lpCommandLine, MAX_PATH-1, "threadsuspension %d %d %d %d", i, WORKER_THREAD_MULTIPLIER_COUNT, REPEAT_COUNT, RELATION_ID) < 0 )
{
- Trace ("Error: Insufficient commandline string length for for iteration [%d]\n", i);
+ Trace ("Error: Insufficient commandline string length for iteration [%d]\n", i);
}
-
+
/* Zero the data structure space */
ZeroMemory ( &pi[i], sizeof(pi[i]) );
ZeroMemory ( &si[i], sizeof(si[i]) );
//Printing the Command Line
//Trace("Command Line \t %s \n", lpCommandLine);
-
+
//Create Process
if(!CreateProcess( NULL, /* lpApplicationName*/
lpCommandLine, /* lpCommandLine */
))
{
Fail("Process Not created for [%d] and GetLastError value is %d\n", i, GetLastError());
-
+
}
else
{
}
- returnCode = WaitForMultipleObjects( USE_PROCESS_COUNT, hProcess, TRUE, INFINITE);
+ returnCode = WaitForMultipleObjects( USE_PROCESS_COUNT, hProcess, TRUE, INFINITE);
if( WAIT_OBJECT_0 != returnCode )
{
Trace("Wait for Object(s) @ Main thread for %d processes returned %d, and GetLastError value is %d\n", USE_PROCESS_COUNT, returnCode, GetLastError());
/* check the exit code from the process */
if( ! GetExitCodeProcess( pi[i].hProcess, &processReturnCode ) )
{
- Trace( "GetExitCodeProcess call failed for iteration %d with error code %u\n",
- i, GetLastError() );
-
+ Trace( "GetExitCodeProcess call failed for iteration %d with error code %u\n",
+ i, GetLastError() );
+
testReturnCode = FAIL;
}
if(processReturnCode == FAIL)
{
- Trace( "Process [%d] failed and returned FAIL\n", i);
+ Trace( "Process [%d] failed and returned FAIL\n", i);
testReturnCode = FAIL;
}
{
Trace("Test Failed\n");
}
-
+
//Write Process Result Contents to File
if(hFile!= NULL)
- {
+ {
fprintf(hFile, "%lu,%d,%d,%d,%d,%s\n", appStats.operationTime, appStats.relationId, appStats.processCount, appStats.threadCount, appStats.repeatCount, appStats.buildNumber);
}
Trace("Error:%d: fclose failed for file %s\n", GetLastError(), fileName);
}
PAL_Terminate();
-
+
if( testReturnCode == PASS)
{
else
{
return FAIL;
-
- }
-
+
+ }
+
}
** This test is for WFMO Test case for Mutex
** Algorithm
** o Create PROCESS_COUNT processes.
-** o Main Thread of each process creates OBJECT_TYPE Object
+** o Main Thread of each process creates OBJECT_TYPE Object
**
** Author: ShamitP
**
int GetParameters( int argc, char **argv)
{
- if( (argc != 6) || ((argc == 1) && !strcmp(argv[1],"/?"))
+ if( (argc != 6) || ((argc == 1) && !strcmp(argv[1],"/?"))
|| !strcmp(argv[1],"/h") || !strcmp(argv[1],"/H"))
{
printf("PAL -Composite WFMO Test\n");
printf("Usage:\n");
- printf("main\n\t[PROCESS_COUNT [greater than 0] \n");
- printf("\t[THREAD_COUNT [greater than 0] \n");
+ printf("main\n\t[PROCESS_COUNT [greater than 0] \n");
+ printf("\t[THREAD_COUNT [greater than 0] \n");
printf("\t[REPEAT_COUNT [greater than 0]\n");
printf("\t[SLEEP_LENGTH [greater than 0]\n");
- printf("\t[RELATION_ID [greater than 0]\n");
+ printf("\t[RELATION_ID [greater than 0]\n");
+
-
return -1;
}
PROCESS_COUNT = atoi(argv[1]);
- if( (PROCESS_COUNT < 1) || (PROCESS_COUNT > MAXIMUM_WAIT_OBJECTS) )
+ if( (PROCESS_COUNT < 1) || (PROCESS_COUNT > MAXIMUM_WAIT_OBJECTS) )
{
printf("\nMain Process:Invalid PROCESS_COUNT number, Pass greater than 1 and less than PROCESS_COUNT %d\n", MAXIMUM_WAIT_OBJECTS);
return -1;
}
REPEAT_COUNT = atoi(argv[3]);
- if( REPEAT_COUNT < 1)
+ if( REPEAT_COUNT < 1)
{
printf("\nMain Process:Invalid REPEAT_COUNT number, Pass greater than 1\n");
return -1;
}
SLEEP_LENGTH = atoi(argv[4]);
- if( SLEEP_LENGTH < 1)
+ if( SLEEP_LENGTH < 1)
{
printf("\nMain Process:Invalid SLEEP_LENGTH number, Pass greater than 1\n");
return -1;
}
RELATION_ID = atoi(argv[5]);
- if( RELATION_ID < 1)
+ if( RELATION_ID < 1)
{
printf("\nMain Process:Invalid RELATION_ID number, Pass greater than 1\n");
return -1;
{
unsigned int i = 0;
HANDLE hProcess[MAXIMUM_WAIT_OBJECTS];
-
+
STARTUPINFO si[MAXIMUM_WAIT_OBJECTS];
PROCESS_INFORMATION pi[MAXIMUM_WAIT_OBJECTS];
Fail("Error in obtaining the parameters\n");
}
- /* Register the start time */
+ /* Register the start time */
dwStartTime = GetTickCount();
testStats.relationId = 0;
testStats.relationId = RELATION_ID;
_snprintf(fileName, MAX_PATH, "main_wfmo_%d_.txt",testStats.relationId);
pFile = fopen(fileName, "w+");
if(pFile == NULL)
- {
+ {
Fail("Error in opening main file for write\n");
}
ZeroMemory( lpCommandLine, MAX_PATH );
if ( _snprintf( lpCommandLine, MAX_PATH-1, "mutex %d %d %d %d %d", i, THREAD_COUNT, REPEAT_COUNT, SLEEP_LENGTH, RELATION_ID) < 0 )
{
- Trace ("Error: Insufficient commandline string length for for iteration [%d]\n", i);
+ Trace ("Error: Insufficient commandline string length for iteration [%d]\n", i);
}
-
+
/* Zero the data structure space */
ZeroMemory ( &pi[i], sizeof(pi[i]) );
ZeroMemory ( &si[i], sizeof(si[i]) );
/* Set the process flags and standard io handles */
si[i].cb = sizeof(si[i]);
-
+
//Create Process
if(!CreateProcess( NULL, /* lpApplicationName*/
lpCommandLine, /* lpCommandLine */
}
- returnCode = WaitForMultipleObjects( PROCESS_COUNT, hProcess, TRUE, INFINITE);
+ returnCode = WaitForMultipleObjects( PROCESS_COUNT, hProcess, TRUE, INFINITE);
if( WAIT_OBJECT_0 != returnCode )
{
Trace("Wait for Object(s) @ Main thread for %d processes returned %d, and GetLastError value is %d\n", PROCESS_COUNT, returnCode, GetLastError());
}
-
+
for( i = 0; i < PROCESS_COUNT; i++ )
{
/* check the exit code from the process */
if( ! GetExitCodeProcess( pi[i].hProcess, &processReturnCode ) )
{
- Trace( "GetExitCodeProcess call failed for iteration %d with error code %u\n",
- i, GetLastError() );
-
+ Trace( "GetExitCodeProcess call failed for iteration %d with error code %u\n",
+ i, GetLastError() );
+
testReturnCode = FAIL;
}
if(processReturnCode == FAIL)
{
- Trace( "Process [%d] failed and returned FAIL\n", i);
+ Trace( "Process [%d] failed and returned FAIL\n", i);
testReturnCode = FAIL;
}
}
}
- testStats.operationTime = GetTimeDiff(dwStartTime);
+ testStats.operationTime = GetTimeDiff(dwStartTime);
fprintf(pFile, "%d,%d,%d,%d,%d,%s\n", testStats.operationTime, testStats.relationId, testStats.processCount, testStats.threadCount, testStats.repeatCount, testStats.buildNumber);
if(fclose(pFile))
{
Trace("Error: fclose failed for pFile\n");
testReturnCode = FAIL;
}
-
+
if( testReturnCode == PASS)
{
Trace("Test Passed\n");
** Example: test_directory\level1\..\testing.tmp.
** To add to this test, we will also call SetCurrentDirectory to
** ensure this is handled properly.
-** The test will create a file with in the parent directory
+** The test will create a file with in the parent directory
** to verify that the returned directory is valid.
**
** Depends: SetCurrentDirectory,
** strcmp,
** DeleteFileA,
** RemoveDirectory.
-**
+**
**
**===================================================================*/
PALTEST(file_io_GetFullPathNameA_test3_paltest_getfullpathnamea_test3, "file_io/GetFullPathNameA/test3/paltest_getfullpathnamea_test3")
{
#ifdef WIN32
- const char* szSeperator = "\\";
+ const char* szSeparator = "\\";
#else
- const char* szSeperator = "//";
+ const char* szSeparator = "//";
#endif
const char* szDotDot = "..\\";
GetLastError(),
szDotDot);
}
-
+
/* Create the path to the next level of directory to create.
*/
strcat( szDirectory, szCreatedDir );
/* Create the path to the next level of directory to create.
*/
- strcat( szDirectory, szSeperator );
+ strcat( szDirectory, szSeparator );
strcat( szDirectory, szCreatedNextDir );
/* Create a test directory.
bRetVal = FAIL;
goto cleanUpOne;
}
-
+
/* Initialize the receiving char buffers.
*/
memset(szReturnedPath, 0, _MAX_DIR+1);
/* Get the full path to the filename.
*/
- dwRc = GetFullPathNameA(szFullFileName,
+ dwRc = GetFullPathNameA(szFullFileName,
_MAX_DIR,
- szReturnedPath,
+ szReturnedPath,
&pPathPtr);
if (dwRc == 0)
{
goto cleanUpTwo;
}
- /* The returned value should be the parent directory with the
+ /* The returned value should be the parent directory with the
* file name appended. */
hFile = CreateFileA(szReturnedPath,
GENERIC_READ,
if (hFile == INVALID_HANDLE_VALUE)
{
- Trace("ERROR :%ld: CreateFileA failed to create \"%s\".\n",
+ Trace("ERROR :%ld: CreateFileA failed to create \"%s\".\n",
GetLastError(),
szReturnedPath);
bRetVal = FAIL;
goto cleanUpThree;
}
- /* Verify that the file was created, attempt to create
+ /* Verify that the file was created, attempt to create
* the file again. */
hFile = CreateFileA(szReturnedPath,
GENERIC_READ,
CREATE_NEW,
FILE_ATTRIBUTE_NORMAL,
NULL);
- if ((hFile != INVALID_HANDLE_VALUE) &&
+ if ((hFile != INVALID_HANDLE_VALUE) &&
(GetLastError() != ERROR_ALREADY_EXISTS))
{
Trace("ERROR :%ld: CreateFileA succeeded to create file "
{
Trace("ERROR : Returned filename \"%s\" is not equal to "
"supplied filename \"%s\".\n",
- pPathPtr,
+ pPathPtr,
szFileName);
bRetVal = FAIL;
goto cleanUpThree;
bRetVal = PASS;
cleanUpThree:
-
- /* Delete the create file.
+
+ /* Delete the create file.
*/
if (DeleteFileA(szReturnedPath) != TRUE)
{
** Example: ..\test_directory\testing.tmp.
** To add to this test, we will also call SetCurrentDirectory to
** ensure this is handled properly.
-** The test will create a file with in the parent directory
+** The test will create a file with in the parent directory
** to verify that the returned directory is valid.
**
** Depends: SetCurrentDirectory,
** strcmp,
** DeleteFileA,
** RemoveDirectory.
-**
+**
**
**===================================================================*/
PALTEST(file_io_GetFullPathNameA_test4_paltest_getfullpathnamea_test4, "file_io/GetFullPathNameA/test4/paltest_getfullpathnamea_test4")
{
#ifdef WIN32
- const char* szSeperator = "\\";
+ const char* szSeparator = "\\";
#else
- const char* szSeperator = "//";
+ const char* szSeparator = "//";
#endif
const char* szDotDot = "..";
/* Create the path to the next level of directory to create.
*/
strcat( szDirectory, szDotDot ); /* .. */
- strcat( szDirectory, szSeperator ); /* ../ */
+ strcat( szDirectory, szSeparator ); /* ../ */
strcat( szDirectory, szCreatedDir ); /* ../test_directory */
/* Create a test directory.
* in the middle of the path.
*/
strcat( szFullFileName, szDotDot ); /* .. */
- strcat( szFullFileName, szSeperator ); /* ../ */
+ strcat( szFullFileName, szSeparator ); /* ../ */
strcat( szFullFileName, szCreatedDir ); /* ../test_directory */
- strcat( szFullFileName, szSeperator ); /* ../test_directory/ */
+ strcat( szFullFileName, szSeparator ); /* ../test_directory/ */
strcat( szFullFileName, szFileName ); /* ../test_directory/testing.tmp */
/* Get the full path to the filename.
*/
- dwRc = GetFullPathNameA(szFullFileName,
+ dwRc = GetFullPathNameA(szFullFileName,
_MAX_DIR,
- szReturnedPath,
+ szReturnedPath,
&pPathPtr);
if (dwRc == 0)
{
goto cleanUpOne;
}
- /* The returned value should be the parent directory with the
+ /* The returned value should be the parent directory with the
* file name appended. */
hFile = CreateFileA(szReturnedPath,
GENERIC_READ,
if (hFile == INVALID_HANDLE_VALUE)
{
- Trace("ERROR :%ld: CreateFileA failed to create \"%s\".\n",
+ Trace("ERROR :%ld: CreateFileA failed to create \"%s\".\n",
GetLastError(),
szReturnedPath);
bRetVal = FAIL;
goto cleanUpTwo;
}
- /* Verify that the file was created, attempt to create
+ /* Verify that the file was created, attempt to create
* the file again. */
hFile = CreateFileA(szReturnedPath,
GENERIC_READ,
CREATE_NEW,
FILE_ATTRIBUTE_NORMAL,
NULL);
- if ((hFile != INVALID_HANDLE_VALUE) &&
+ if ((hFile != INVALID_HANDLE_VALUE) &&
(GetLastError() != ERROR_ALREADY_EXISTS))
{
Trace("ERROR :%ld: CreateFileA succeeded to create file "
{
Trace("ERROR : Returned filename \"%s\" is not equal to "
"supplied filename \"%s\".\n",
- pPathPtr,
+ pPathPtr,
szFileName);
bRetVal = FAIL;
goto cleanUpTwo;
bRetVal = PASS;
cleanUpTwo:
-
- /* Delete the create file.
+
+ /* Delete the create file.
*/
if (DeleteFileA(szReturnedPath) != TRUE)
{
** Example: test_directory\level1\..\testing.tmp.
** To add to this test, we will also call SetCurrentDirectory to
** ensure this is handled properly.
-** The test will create a file with in the parent directory
+** The test will create a file with in the parent directory
** to verify that the returned directory is valid.
**
** Depends: SetCurrentDirectory,
** strcmp,
** DeleteFileW,
** RemoveDirectory.
-**
+**
**
**===================================================================*/
PALTEST(file_io_GetFullPathNameW_test3_paltest_getfullpathnamew_test3, "file_io/GetFullPathNameW/test3/paltest_getfullpathnamew_test3")
{
#ifdef WIN32
- const WCHAR szSeperator[] = {'\\','\\','\0'};
+ const WCHAR szSeparator[] = {'\\','\\','\0'};
#else
- const WCHAR szSeperator[] = {'/','/','\0'};
+ const WCHAR szSeparator[] = {'/','/','\0'};
#endif
const WCHAR szDotDot[] = {'.','.','\0'};
/* Create the path to the next level of directory to create.
*/
- wcscat(szDirectory, szCreatedDir); /* test_dir */
+ wcscat(szDirectory, szCreatedDir); /* test_dir */
/* Create a test directory.
/* Create the path to the next level of directory to create.
*/
- wcscat(szDirectory, szSeperator); /* / */
+ wcscat(szDirectory, szSeparator); /* / */
wcscat(szDirectory, szCreatedNextDir); /* /level1 */
/* Create a test directory.
* in the middle of the path.
*/
wcscat(szFullFileName, szCreatedDir); /*test_dir */
- wcscat(szFullFileName, szSeperator); /*test_dir/ */
+ wcscat(szFullFileName, szSeparator); /*test_dir/ */
wcscat(szFullFileName, szCreatedNextDir);/*test_dir/level1 */
- wcscat(szFullFileName, szSeperator); /*test_dir/level1/ */
+ wcscat(szFullFileName, szSeparator); /*test_dir/level1/ */
wcscat(szFullFileName, szDotDot); /*test_dir/level1/.. */
- wcscat(szFullFileName, szSeperator); /*test_dir/level1/../ */
+ wcscat(szFullFileName, szSeparator); /*test_dir/level1/../ */
wcscat(szFullFileName, szFileName); /*test_dir/level1/../testing.tmp */
/* Get the full path to the filename.
*/
- dwRc = GetFullPathNameW(szFullFileName,
+ dwRc = GetFullPathNameW(szFullFileName,
_MAX_DIR,
- szReturnedPath,
+ szReturnedPath,
&pPathPtr);
if (dwRc == 0)
{
goto cleanUpTwo;
}
- /* The returned value should be the parent directory with the
+ /* The returned value should be the parent directory with the
* file name appended. */
hFile = CreateFileW(szReturnedPath,
GENERIC_READ,
if (hFile == INVALID_HANDLE_VALUE)
{
- Trace("ERROR :%ld: CreateFileA failed to create \"%S\".\n",
+ Trace("ERROR :%ld: CreateFileA failed to create \"%S\".\n",
GetLastError(),
szReturnedPath);
bRetVal = FAIL;
goto cleanUpThree;
}
- /* Verify that the file was created, attempt to create
+ /* Verify that the file was created, attempt to create
* the file again. */
hFile = CreateFileW(szReturnedPath,
GENERIC_READ,
CREATE_NEW,
FILE_ATTRIBUTE_NORMAL,
NULL);
- if ((hFile != INVALID_HANDLE_VALUE) &&
+ if ((hFile != INVALID_HANDLE_VALUE) &&
(GetLastError() != ERROR_ALREADY_EXISTS))
{
Trace("ERROR :%ld: CreateFileA succeeded to create file "
{
Trace("ERROR : Returned filename \"%s\" is not equal to "
"supplied filename \"%s\".\n",
- pPathPtr,
+ pPathPtr,
szFileName);
bRetVal = FAIL;
goto cleanUpThree;
cleanUpThree:
- /* Delete the create file.
+ /* Delete the create file.
*/
if (DeleteFileW(szReturnedPath) != TRUE)
{
GetLastError(),
szFileName);
}
-
+
cleanUpTwo:
/* Remove the empty directory.
GetLastError(),
szCreatedDir);
}
-
+
/* Terminate the PAL.*/
PAL_TerminateEx(bRetVal);
return bRetVal;
** Example: ..\test_directory\testing.tmp.
** To add to this test, we will also call SetCurrentDirectory to
** ensure this is handled properly.
-** The test will create a file with in the parent directory
+** The test will create a file with in the parent directory
** to verify that the returned directory is valid.
**
** Depends: SetCurrentDirectory,
** strcmp,
** DeleteFileW,
** RemoveDirectory.
-**
+**
**
**===================================================================*/
PALTEST(file_io_GetFullPathNameW_test4_paltest_getfullpathnamew_test4, "file_io/GetFullPathNameW/test4/paltest_getfullpathnamew_test4")
{
#ifdef WIN32
- const WCHAR szSeperator[] = {'\\','\\','\0'};
+ const WCHAR szSeparator[] = {'\\','\\','\0'};
#else
- const WCHAR szSeperator[] = {'/','/','\0'};
+ const WCHAR szSeparator[] = {'/','/','\0'};
#endif
const WCHAR szDotDot[] = {'.','.','\0'};
/* Create the path to the next level of directory to create.
*/
wcscat(szDirectory, szDotDot); /* .. */
- wcscat(szDirectory, szSeperator); /* ../ */
+ wcscat(szDirectory, szSeparator); /* ../ */
wcscat(szDirectory, szCreatedDir); /* ../test_directory */
/* Create a test directory.
* in the middle of the path.
*/
wcscat( szFullFileName, szDotDot ); /* .. */
- wcscat( szFullFileName, szSeperator ); /* ../ */
+ wcscat( szFullFileName, szSeparator ); /* ../ */
wcscat( szFullFileName, szCreatedDir ); /* ../test_directory */
- wcscat( szFullFileName, szSeperator ); /* ../test_directory/ */
+ wcscat( szFullFileName, szSeparator ); /* ../test_directory/ */
wcscat( szFullFileName, szFileName ); /* ../test_directory/testing.tmp */
/* Get the full path to the filename.
*/
- dwRc = GetFullPathNameW(szFullFileName,
+ dwRc = GetFullPathNameW(szFullFileName,
_MAX_DIR,
- szReturnedPath,
+ szReturnedPath,
&pPathPtr);
if (dwRc == 0)
{
goto cleanUpOne;
}
- /* The returned value should be the parent directory with the
+ /* The returned value should be the parent directory with the
* file name appended. */
hFile = CreateFileW(szReturnedPath,
GENERIC_READ,
if (hFile == INVALID_HANDLE_VALUE)
{
- Trace("ERROR :%ld: CreateFileA failed to create \"%S\".\n",
+ Trace("ERROR :%ld: CreateFileA failed to create \"%S\".\n",
GetLastError(),
szReturnedPath);
bRetVal = FAIL;
goto cleanUpTwo;
}
- /* Verify that the file was created, attempt to create
+ /* Verify that the file was created, attempt to create
* the file again. */
hFile = CreateFileW(szReturnedPath,
GENERIC_READ,
CREATE_NEW,
FILE_ATTRIBUTE_NORMAL,
NULL);
- if ((hFile != INVALID_HANDLE_VALUE) &&
+ if ((hFile != INVALID_HANDLE_VALUE) &&
(GetLastError() != ERROR_ALREADY_EXISTS))
{
Trace("ERROR :%ld: CreateFileA succeeded to create file "
{
Trace("ERROR : Returned filename \"%S\" is not equal to "
"supplied filename \"%S\".\n",
- pPathPtr,
+ pPathPtr,
szFileName);
bRetVal = FAIL;
goto cleanUpTwo;
bRetVal = PASS;
cleanUpTwo:
-
- /* Delete the create file.
+
+ /* Delete the create file.
*/
if (DeleteFileW(szReturnedPath) != TRUE)
{
/*============================================================
**
-** Source: test1.c
+** Source: test1.c
**
** Purpose: Test for CreateThread. Call CreateThread and ensure
-** that it succeeds. Also check to ensure the paramater is passed
+** that it succeeds. Also check to ensure the parameter is passed
** properly.
**
**
DWORD PALAPI CreateThreadTestThread( LPVOID lpParameter)
{
DWORD dwRet = 0;
-
+
/* save parameter for test */
dwCreateThreadTestParameter = (ULONGLONG)lpParameter;
-
+
return dwRet;
}
DWORD dwRet = 0;
LPSECURITY_ATTRIBUTES lpThreadAttributes = NULL;
- DWORD dwStackSize = 0;
+ DWORD dwStackSize = 0;
LPTHREAD_START_ROUTINE lpStartAddress = &CreateThreadTestThread;
LPVOID lpParameter = (LPVOID)lpStartAddress;
DWORD dwCreationFlags = 0; /* run immediately */
dwCreateThreadTestParameter = 0;
- /* Create a thread, passing the appropriate paramaters as declared
+ /* Create a thread, passing the appropriate parameters as declared
above.
*/
-
- hThread = CreateThread( lpThreadAttributes,
- dwStackSize,
- lpStartAddress,
- lpParameter,
- dwCreationFlags,
- &dwThreadId );
-
+
+ hThread = CreateThread( lpThreadAttributes,
+ dwStackSize,
+ lpStartAddress,
+ lpParameter,
+ dwCreationFlags,
+ &dwThreadId );
+
/* Ensure that the HANDLE is not invalid! */
if (hThread != INVALID_HANDLE_VALUE)
{
/* Check to ensure that the parameter passed to the thread
function is the same in the function as what we passed.
*/
-
+
if (dwCreateThreadTestParameter != (ULONGLONG)lpParameter)
{
Trace("CreateThreadTest:parameter error. The "
Trace("CreateThreadTest:CreateThread failed (%x)\n",GetLastError());
}
- return bRet;
+ return bRet;
}
{
return ( FAIL );
}
-
- if(!CreateThreadTest())
+
+ if(!CreateThreadTest())
{
Fail ("Test failed\n");
}
-
+
Trace("Test Passed\n");
PAL_Terminate();
return ( PASS );
/*============================================================
**
-** Source: test1.c
+** Source: test1.c
**
** Purpose: Test for ExitThread. Create a thread and then call
** exit thread within the threading function. Ensure that it exits
/* Call the ExitThread function */
ExitThread(dwRet);
- /* If we didn't exit, get caught in this loop. But, the
+ /* If we didn't exit, get caught in this loop. But, the
program will exit.
*/
while (!dwRet)
DWORD dwRet = 0;
LPSECURITY_ATTRIBUTES lpThreadAttributes = NULL;
- DWORD dwStackSize = 0;
+ DWORD dwStackSize = 0;
LPTHREAD_START_ROUTINE lpStartAddress = &ExitThreadTestThread;
LPVOID lpParameter = (LPVOID)lpStartAddress;
DWORD dwCreationFlags = 0; //run immediately
dwExitThreadTestParameter = 0;
/* Create a Thread. We'll need this to test that we're able
- to exit the thread.
+ to exit the thread.
*/
- hThread = CreateThread( lpThreadAttributes,
- dwStackSize, lpStartAddress, lpParameter,
- dwCreationFlags, &dwThreadId );
-
+ hThread = CreateThread( lpThreadAttributes,
+ dwStackSize, lpStartAddress, lpParameter,
+ dwCreationFlags, &dwThreadId );
+
if (hThread != INVALID_HANDLE_VALUE)
{
dwRet = WaitForSingleObject(hThread,INFINITE);
-
+
if (dwRet != WAIT_OBJECT_0)
{
Trace("ExitThreadTest:WaitForSingleObject failed "
*/
if (dwExitThreadTestParameter != (DWORD)(SIZE_T)lpParameter)
{
- Trace("ERROR: The paramater passed should have been "
+ Trace("ERROR: The parameter passed should have been "
"%d but turned up as %d.",
dwExitThreadTestParameter, lpParameter);
}
Trace("ExitThreadTest:CreateThread failed (%x)\n",GetLastError());
}
- return bRet;
+ return bRet;
}
PALTEST(threading_ExitThread_test1_paltest_exitthread_test1, "threading/ExitThread/test1/paltest_exitthread_test1")
{
Fail ("Test failed\n");
}
-
+
PAL_Terminate();
return ( PASS );
}
** Purpose: Test the functionality of simultaneously waiting
** on multiple processes. Create the same number of helper
** processes and helper threads.
-** Helper threads wait on helper processes to finish.
+** Helper threads wait on helper processes to finish.
** Helper processes wait on the event signal from test
** thread before exit.
** The test thread can wake up one helper
should be waked up using hThreadFinishEvent instead of helper process. */
DWORD ThreadIndexOfThreadFinishEvent = 0;
-struct helper_process_t
+struct helper_process_t
{
PROCESS_INFORMATION pi;
HANDLE hProcessReadyEvent;
HANDLE hProcessStartEvent_WFMO_test5;
-struct helper_thread_t
+struct helper_thread_t
{
HANDLE hThread;
DWORD dwThreadId;
HANDLE hThreadFinishEvent;
} helper_thread[MAX_HELPER_PROCESS];
-/*
+/*
* Entry Point for helper thread.
*/
DWORD PALAPI WaitForProcess(LPVOID lpParameter)
if(!SetEvent(helper_thread[index].hThreadReadyEvent))
{
Fail("test5.WaitProcess: SetEvent of hThreadReadyEvent failed for thread %d. "
- "GetLastError() returned %d.\n", index,
+ "GetLastError() returned %d.\n", index,
GetLastError());
}
if (dwRet != (WAIT_OBJECT_0+0))
{
Fail("test5.WaitForProcess: invalid return value %d for WakupAllThread from WaitForMultipleObjectsEx for thread %d\n"
- "LastError:(%u)\n",
+ "LastError:(%u)\n",
dwRet, index,
GetLastError());
}
the return value must be either (WAIT_OBJECT_0+index) if the helper thread
wakes up because the corresponding help process exits,
or (index+1) if the helper thread wakes up because of hThreadReadyEvent. */
- if ((index != ThreadIndexOfThreadFinishEvent && dwRet != (WAIT_OBJECT_0+index)) ||
+ if ((index != ThreadIndexOfThreadFinishEvent && dwRet != (WAIT_OBJECT_0+index)) ||
(index == ThreadIndexOfThreadFinishEvent && dwRet != (index+1)))
{
Fail("test5.WaitForProcess: invalid return value %d for WakupOneThread from WaitForMultipleObjectsEx for thread %d\n"
- "LastError:(%u)\n",
+ "LastError:(%u)\n",
dwRet, index,
GetLastError());
}
return 0;
}
-/*
+/*
* Setup the helper processes and helper threads.
*/
void
STARTUPINFO si;
DWORD dwRet;
int i;
-
+
char szEventName[MAX_PATH];
PWCHAR uniStringHelper;
PWCHAR uniString;
uniString = convert(szcHelperProcessStartEvName);
hProcessStartEvent_WFMO_test5 = CreateEvent(NULL, TRUE, FALSE, uniString);
free(uniString);
- if (!hProcessStartEvent_WFMO_test5)
+ if (!hProcessStartEvent_WFMO_test5)
{
Fail("test5.Setup: CreateEvent of '%s' failed. "
- "GetLastError() returned %d.\n", szcHelperProcessStartEvName,
+ "GetLastError() returned %d.\n", szcHelperProcessStartEvName,
GetLastError());
}
for (i = 0; i < MaxNumHelperProcess; i++)
{
ZeroMemory( &helper_process[i].pi, sizeof(PROCESS_INFORMATION));
-
- if(!CreateProcess( NULL, uniStringHelper, NULL, NULL,
- FALSE, 0, NULL, NULL, &si, &helper_process[i].pi))
+
+ if(!CreateProcess( NULL, uniStringHelper, NULL, NULL,
+ FALSE, 0, NULL, NULL, &si, &helper_process[i].pi))
{
Fail("test5.Setup: CreateProcess failed to load executable for helper process %d. "
"GetLastError() returned %u.\n",
helper_process[i].hProcessReadyEvent = CreateEvent(NULL, FALSE, FALSE, uniString);
free(uniString);
- if (!helper_process[i].hProcessReadyEvent)
+ if (!helper_process[i].hProcessReadyEvent)
{
Fail("test5.Setup: CreateEvent of '%s' failed. "
- "GetLastError() returned %d.\n", szEventName,
+ "GetLastError() returned %d.\n", szEventName,
GetLastError());
}
helper_process[i].hProcessFinishEvent = CreateEvent(NULL, TRUE, FALSE, uniString);
free(uniString);
- if (!helper_process[i].hProcessFinishEvent)
+ if (!helper_process[i].hProcessFinishEvent)
{
Fail("test5.Setup: CreateEvent of '%s' failed. "
- "GetLastError() returned %d.\n", szEventName,
+ "GetLastError() returned %d.\n", szEventName,
GetLastError());
}
/* Wait for ready signals from all helper processes. */
for (i = 0; i < MaxNumHelperProcess; i++)
- {
+ {
dwRet = WaitForSingleObject(helper_process[i].hProcessReadyEvent, TIMEOUT);
if (dwRet != WAIT_OBJECT_0)
{
Fail("test5.Setup: WaitForSingleObject %s failed for helper process %d\n"
- "LastError:(%u)\n",
+ "LastError:(%u)\n",
szcHelperProcessReadyEvName, i, GetLastError());
}
}
{
/* Create the event to let helper thread tell us it is ready. */
helper_thread[i].hThreadReadyEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
- if (!helper_thread[i].hThreadReadyEvent)
+ if (!helper_thread[i].hThreadReadyEvent)
{
Fail("test5.Setup: CreateEvent of hThreadReadyEvent failed for thread %d\n"
"LastError:(%u)\n", i, GetLastError());
/* Create the event to tell helper thread to exit without waiting for helper process. */
helper_thread[i].hThreadFinishEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
- if (!helper_thread[i].hThreadFinishEvent)
+ if (!helper_thread[i].hThreadFinishEvent)
{
Fail("test5.Setup: CreateEvent of hThreadFinishEvent failed for thread %d\n"
"LastError:(%u)\n", i, GetLastError());
}
/* Create the helper thread. */
- helper_thread[i].hThread = CreateThread( NULL,
- 0,
+ helper_thread[i].hThread = CreateThread( NULL,
+ 0,
(LPTHREAD_START_ROUTINE)WaitForProcess,
(LPVOID)i,
0,
/* Wait for ready signals from all helper threads. */
for (i = 0; i < MaxNumHelperProcess; i++)
- {
+ {
dwRet = WaitForSingleObject(helper_thread[i].hThreadReadyEvent, TIMEOUT);
if (dwRet != WAIT_OBJECT_0)
{
}
}
-/*
+/*
* Cleanup the helper processes and helper threads.
*/
DWORD
"LastError:(%u)\n", i, GetLastError());
}
- /* check the exit code from the process */
+ /* check the exit code from the process */
if (!GetExitCodeProcess(helper_process[i].pi.hProcess, &dwExitCode))
{
- Trace( "test5.Cleanup: GetExitCodeProcess %d call failed LastError:(%u)\n",
- i, GetLastError());
+ Trace( "test5.Cleanup: GetExitCodeProcess %d call failed LastError:(%u)\n",
+ i, GetLastError());
dwExitCode = FAIL;
}
PEDANTIC(CloseHandle, (helper_process[i].pi.hThread));
PEDANTIC(CloseHandle, (helper_process[i].pi.hProcess));
- PEDANTIC(CloseHandle, (helper_process[i].hProcessReadyEvent));
+ PEDANTIC(CloseHandle, (helper_process[i].hProcessReadyEvent));
PEDANTIC(CloseHandle, (helper_process[i].hProcessFinishEvent));
}
return dwExitCode;
}
-/*
+/*
* In this test case, the test thread will signal one helper
* process to exit at a time starting from the last helper
* process and then wait for the corresponding helper thread to exit.
Fail("test5.TestWaitOnOneThread: Invalid ThreadIndexOfThreadFinishEvent %d\n", ThreadIndexOfThreadFinishEvent);
/* Since helper thread 0 waits on helper process 0,
- thread 1 waits on on process 0, and 1,
+ thread 1 waits on process 0, and 1,
thread 2 waits on process 0, 1, and 2, and so on ...,
and the last helper thread will wait on all helper processes,
the helper thread can be waked up one at a time by
GetLastError());
}
}
-
+
dwRet = WaitForSingleObject(helper_thread[i].hThread, TIMEOUT);
if (WAIT_OBJECT_0 != dwRet)
{
Fail("test5.TestWaitOnOneThread: WaitForSingleObject helper thread %d"
- "LastError:(%u)\n",
+ "LastError:(%u)\n",
i, GetLastError());
}
}
-
+
/* Finally, need to wake up the helper process which the test thread
skips waking up in the last loop. */
if (!SetEvent(helper_process[ThreadIndexOfThreadFinishEvent].hProcessFinishEvent))
}
}
-/*
+/*
* In this test case, the test thread will signal the helper
* process 0 to exit. Since all helper threads wait on process 0,
* all helper threads will wake up and exit, and the test thread
/* Wait for all helper threads to exit. */
for (i = 0; i < MaxNumHelperProcess; i++)
{
-
+
dwRet = WaitForSingleObject(helper_thread[i].hThread, TIMEOUT);
if (WAIT_OBJECT_0 != dwRet)
{
Fail("test5.TestWaitOnAllThread: WaitForSingleObject failed for helper thread %d\n"
- "LastError:(%u)\n",
+ "LastError:(%u)\n",
i, GetLastError());
}
}
- /* Signal the rest of helper processes to exit. */
+ /* Signal the rest of helper processes to exit. */
for (i = 1; i < MaxNumHelperProcess; i++)
{
if (!SetEvent(helper_process[i].hProcessFinishEvent))
structCounts = {}
arrays = {}
templateName = templateNode.getAttribute('tid')
- var_Dependecies = {}
+ var_Dependencies = {}
fnPrototypes = FunctionSignature()
dataNodes = getTopLevelElementsByTagName(templateNode,'data')
if wintype == "win:GUID":
var_Props = "sizeof(GUID)/sizeof(int)"
- var_Dependecies[variable] = var_dependency
+ var_Dependencies[variable] = var_dependency
fnparam = FunctionParameter(wintype,variable,wincount,var_Props)
fnPrototypes.append(variable,fnparam)
types = [x.attributes['inType'].value for x in structToBeMarshalled.getElementsByTagName("data")]
structCounts[structName] = countVarName
- var_Dependecies[structName] = [countVarName, structName]
+ var_Dependencies[structName] = [countVarName, structName]
fnparam_pointer = FunctionParameter("win:Struct", structName, "win:count", countVarName)
fnPrototypes.append(structName, fnparam_pointer)
- allTemplates[templateName] = Template(templateName, fnPrototypes, var_Dependecies, structCounts, arrays)
+ allTemplates[templateName] = Template(templateName, fnPrototypes, var_Dependencies, structCounts, arrays)
return allTemplates
// Validate classes, structs, enums, interfaces, and delegates
Debug.Assert(type.IsDefType);
- // Don't validate generic definitons
+ // Don't validate generic definitions
if (type.IsGenericDefinition)
{
return type;
}
// If both sides are arrays, then the result is either an array or g_pArrayClass. The above is
- // actually true about the element type for references types, but I think that that is a little
- // excessive for sanity.
+ // actually true for reference types as well, but it is a little excessive to deal with.
if (type1.IsArray && type2.IsArray)
{
TypeDesc arrayClass = _compilation.TypeSystemContext.GetWellKnownType(WellKnownType.Array);
namespace Internal.TypeSystem
{
/// <summary>
- /// RuntimeInterfaces algorithm for for array types which are similar to a generic type
+ /// RuntimeInterfaces algorithm for array types which are similar to a generic type
/// </summary>
public sealed class ArrayOfTRuntimeInterfacesAlgorithm : RuntimeInterfacesAlgorithm
{
private MetadataType _arrayOfTType;
/// <summary>
- /// RuntimeInterfaces algorithm for for array types which are similar to a generic type
+ /// RuntimeInterfaces algorithm for array types which are similar to a generic type
/// </summary>
/// <param name="arrayOfTType">Open type to instantiate to get the interfaces associated with an array.</param>
public ArrayOfTRuntimeInterfacesAlgorithm(MetadataType arrayOfTType)
private readonly int _pointerSize;
- // Represent field layout bits as as a series of intervals to prevent pathological bad behavior
+ // Represent field layout bits as a series of intervals to prevent pathological bad behavior
// involving excessively large explicit layout structures.
private readonly List<FieldLayoutInterval> _fieldLayout;
foreach (MethodDesc memberMethod in unificationGroup.Members)
{
// If a method is both overriden via MethodImpl and name/sig, we don't remove it from the unification list
- // as the local MethodImpl takes priority over the name/sig match, and prevents the slot disunificaiton
+ // as the local MethodImpl takes priority over the name/sig match, and prevents the slot disunification.
if (FindSlotDefiningMethodForVirtualMethod(memberMethod) == FindSlotDefiningMethodForVirtualMethod(originalDefiningMethod))
continue;
unificationGroup.AddMethodRequiringSlotUnification(methodImplRequiredToRemainInEffect);
}
- // Add all members from the decl's unification group except for ones that have been seperated by name/sig matches
+ // Add all members from the decl's unification group except for ones that have been separated by name/sig matches
// or previously processed methodimpls. NOTE: This implies that method impls are order dependent.
if (separatedMethods == null || !separatedMethods.Contains(addDeclGroup.DefiningMethod))
{
// Each type of marshaller knows how to generate the marshalling code for the argument it marshals.
// Marshallers contain method related marshalling information (which is common to all the Marshallers)
- // and also argument specific marshalling informaiton
+ // and also argument specific marshalling information.
abstract partial class Marshaller
{
#region Instance state information
}
}
- public override void AddDependeciesDueToPInvoke(ref DependencyList dependencies, NodeFactory factory, MethodDesc method)
+ public override void AddDependenciesDueToPInvoke(ref DependencyList dependencies, NodeFactory factory, MethodDesc method)
{
}
}
/// <summary>
- /// Retreives method whose runtime handle is suitable for use with GVMLookupForSlot.
+ /// Retrieves method whose runtime handle is suitable for use with GVMLookupForSlot.
/// </summary>
public MethodDesc GetTargetOfGenericVirtualMethodCall(MethodDesc calledMethod)
{
{
factory.MetadataManager.GetDependenciesDueToMethodCodePresence(ref dependencies, factory, method, methodIL);
- factory.InteropStubManager.AddDependeciesDueToPInvoke(ref dependencies, factory, method);
+ factory.InteropStubManager.AddDependenciesDueToPInvoke(ref dependencies, factory, method);
if (method.OwningType is MetadataType mdOwningType
&& mdOwningType.Module.GetGlobalModuleType().GetStaticConstructor() is MethodDesc moduleCctor)
return null;
}
- public override void AddDependeciesDueToPInvoke(ref DependencyList dependencies, NodeFactory factory, MethodDesc method)
+ public override void AddDependenciesDueToPInvoke(ref DependencyList dependencies, NodeFactory factory, MethodDesc method)
{
}
public override void AddInterestingInteropConstructedTypeDependencies(ref DependencyList dependencies, NodeFactory factory, TypeDesc type)
{
}
-
+
public override void AddMarshalAPIsGenericDependencies(ref DependencyList dependencies, NodeFactory factory, MethodDesc method)
{
}
/// </summary>
public abstract class InteropStubManager : ICompilationRootProvider
{
- public abstract void AddDependeciesDueToPInvoke(ref DependencyList dependencies, NodeFactory factory, MethodDesc method);
-
+ public abstract void AddDependenciesDueToPInvoke(ref DependencyList dependencies, NodeFactory factory, MethodDesc method);
+
public abstract void AddInterestingInteropConstructedTypeDependencies(ref DependencyList dependencies, NodeFactory factory, TypeDesc type);
public abstract PInvokeILProvider CreatePInvokeILProvider();
_logger = logger;
}
- public override void AddDependeciesDueToPInvoke(ref DependencyList dependencies, NodeFactory factory, MethodDesc method)
+ public override void AddDependenciesDueToPInvoke(ref DependencyList dependencies, NodeFactory factory, MethodDesc method)
{
if (method.IsPInvoke && method.OwningType is MetadataType type && MarshalHelpers.IsRuntimeMarshallingEnabled(type.Module))
{
// Either
// 1. no constraint resolution at compile time (!directMethod)
// OR 2. no code sharing lookup in call
- // OR 3. we have have resolved to an instantiating stub
+ // OR 3. we have resolved to an instantiating stub
methodAfterConstraintResolution = directMethod;
/// <summary>
/// Implement a dependency analysis framework. This works much like a Garbage Collector's mark algorithm
/// in that it finds a set of nodes from an initial root set.
- ///
+ ///
/// However, in contrast to a typical GC in addition to simple edges from a node, there may also
/// be conditional edges where a node has a dependency if some other specific node exists in the
/// graph, and dynamic edges in which a node has a dependency if some other node exists in the graph,
/// but what that other node might be is not known until it may exist in the graph.
- ///
+ ///
/// This analyzer also attempts to maintain a serialized state of why nodes are in the graph
/// with strings describing the reason a given node was added to the graph. The degree of logging
/// is configurable via the MarkStrategy
- ///
+ ///
/// </summary>
public sealed class DependencyAnalyzer<MarkStrategy, DependencyContextType> : DependencyAnalyzerBase<DependencyContextType> where MarkStrategy : struct, IDependencyAnalysisMarkStrategy<DependencyContextType>
{
Debug.Assert(currentNode.Marked);
// Only some marked objects are interesting for dynamic dependencies
- // store those in a seperate list to avoid excess scanning over non-interesting
+ // store those in a separate list to avoid excess scanning over non-interesting
// nodes during dynamic dependency discovery
if (currentNode.InterestingForDynamicDependencyAnalysis)
{
_markedNodesWithDynamicDependencies.Add(new DynamicDependencyNode(currentNode));
}
- // If this new node satisfies any stored conditional dependencies,
+ // If this new node satisfies any stored conditional dependencies,
// add them to the mark stack
HashSet<DependencyNodeCore<DependencyContextType>.CombinedDependencyListEntry> storedDependencySet = null;
if (_conditional_dependency_store.TryGetValue(currentNode, out storedDependencySet))
}
// Compilation Unit Index is the compilation unit of a given module. If the compilation unit
- // is unknown the module will be given an independent index from other modules, but
- // IsCompilationUnitIndexExact will return false for that index. All compilation unit indices
+ // is unknown the module will be given an independent index from other modules, but
+ // IsCompilationUnitIndexExact will return false for that index. All compilation unit indices
// are >= 2, to allow for 0 and 1 to be sentinel values.
private CompilationUnitIndex ModuleToCompilationUnitIndex(ModuleDesc nonEcmaModule)
{
if (!VersionsWithModule(module))
return CompilationUnitIndex.OutsideOfVersionBubble;
-
- // Assemblies within the version bubble, but not compiled as part of this compilation unit are given
- // unique seperate compilation units. The practical effect of this is that the compiler can assume that
+
+ // Assemblies within the version bubble, but not compiled as part of this compilation unit are given
+ // unique separate compilation units. The practical effect of this is that the compiler can assume that
// types which are entirely defined in one module can be laid out in an optimal fashion, but types
// which are laid out relying on multiple modules cannot have their type layout precisely known as
- // it is unknown if the modules are bounding into a single composite image or into individual assemblies.
+ // it is unknown if the modules are bounding into a single composite image or into individual assemblies.
lock (_moduleCompilationUnits)
{
if (!_moduleCompilationUnits.TryGetValue(module, out CompilationUnitIndex compilationUnit))
// 2. That any assembly which is compiled in the current process may be considered to be part of a single unit.
//
// At some point, the compiler could take new parameters to allow the compiler to know that assemblies not in the current compilation
- // unit are to be compiled into composite images or into seperate binaries, and this helper function could return true for these other
+ // unit are to be compiled into composite images or into separate binaries, and this helper function could return true for these other
// compilation unit shapes.
if (compilationUnitIndex != CompilationUnitIndex.Current)
return false;
{
if (_bits == null)
return false;
-
+
return _bits[(int)CompilationUnitIndex.RESERVEDForHasMultipleCompilationUnits];
}
}
if (other._bits.Length > _bits.Length)
_bits.Length = other._bits.Length;
-
+
if (other._bits.Length < _bits.Length)
{
for (int i = 0; i < other._bits.Length; i++)
// Either
// 1. no constraint resolution at compile time (!directMethod)
// OR 2. no code sharing lookup in call
- // OR 3. we have have resolved to an instantiating stub
+ // OR 3. we have resolved to an instantiating stub
// This check for introducing an instantiation stub comes from the logic in
// MethodTable::TryResolveConstraintMethodApprox at
// Either
// 1. no constraint resolution at compile time (!directMethod)
// OR 2. no code sharing lookup in call
- // OR 3. we have have resolved to an instantiating stub
+ // OR 3. we have resolved to an instantiating stub
methodAfterConstraintResolution = directMethod;
return input.Replace("\\s", separator).Replace("\\\\", "\\");
}
- private static string[] SplitAndUnescape(string input, string separator, char[] seperatorCharArray)
+ private static string[] SplitAndUnescape(string input, string separator, char[] separatorCharArray)
{
- string[] returnValue = input.Split(seperatorCharArray);
+ string[] returnValue = input.Split(separatorCharArray);
for (int i = 0; i < returnValue.Length; i++)
{
returnValue[i] = UnescapeStr(returnValue[i], separator);
ZippedETLReader etlReader = new ZippedETLReader(inputFileName, log);
etlReader.EtlFileName = unzipedEtlFile;
- // Figure out where to put the symbols.
+ // Figure out where to put the symbols.
var inputDir = Path.GetDirectoryName(inputFileName);
if (inputDir.Length == 0)
{
methodPrepareInstruction.Clear();
instantiationBuilder.Clear();
- // Format is FriendlyNameOfMethod~typeIndex~ArgCount~GenericParameterCount:genericParamsSeperatedByColons~MethodName
+ // Format is FriendlyNameOfMethod~typeIndex~ArgCount~GenericParameterCount:genericParamsSeparatedByColons~MethodName
// This format is not sufficient to exactly describe methods, so the runtime component may compile similar methods
// In the various strings \ is escaped to \\ and in the outer ~ csv the ~ character is escaped to \s. In the inner csv : is escaped to \s
try
// add that to the MC, not just the CompileResult), and we don't have any control over
// where the JIT buffer is allocated. To handle this, if the getRelocTypeHint() was
// called on the target address, and the VM returned IMAGE_REL_BASED_REL32, then simply
- // use the low-order 32 bits of the target address. This is unique enough for for assembly
+ // use the low-order 32 bits of the target address. This is unique enough for assembly
// diffs, because the delta will compare identically and won't be dependent on where
// SuperPMI allocated the JIT memory.
void CompileResult::repRecordCallSite(ULONG instrOffset, CORINFO_SIG_INFO* callSig, CORINFO_METHOD_HANDLE methodHandle)
{
-
+
if (RecordCallSiteWithSignature == nullptr)
{
// The most call site records have only `methodHandle`, so creating two separate maps give us better perfomance
bool CompileResult::fndRecordCallSiteMethodHandle(ULONG instrOffset, CORINFO_METHOD_HANDLE* pMethodHandle)
{
-
+
if (RecordCallSiteWithSignature != nullptr && RecordCallSiteWithSignature->GetIndex(instrOffset) != -1)
{
Agnostic_RecordCallSite value = RecordCallSiteWithSignature->Get(instrOffset);
return env;
}
-// Check that there is a difference between the current enviroment variables maps and the prevEnv.
+// Check that there is a difference between the current environment variables maps and the prevEnv.
bool MethodContext::WasEnvironmentChanged(const Environment& prevEnv)
{
if (!IsEnvironmentHeaderEqual(prevEnv))
// was truncated when copied to the buffer.
//
// Operation:
-//
+//
// On entry, `*pnBufLen` specifies the size of the buffer pointed to by `*ppBuf` as a count of characters.
// There are two cases:
// 1. If the size is zero, the function computes the length of the representation and returns that.
}
// do an assert. will return true if the code should retry (DebugBreak)
-// returns false, if the assert should be igored.
+// returns false, if the assert should be ignored.
int interceptor_ICJI::doAssert(const char* szFile, int iLine, const char* szExpr)
{
mc->cr->AddCall("doAssert");
// was truncated when copied to the buffer.
//
// Operation:
-//
+//
// On entry, `*pnBufLen` specifies the size of the buffer pointed to by `*ppBuf` as a count of characters.
// There are two cases:
// 1. If the size is zero, the function computes the length of the representation and returns that.
}
// do an assert. will return true if the code should retry (DebugBreak)
-// returns false, if the assert should be igored.
+// returns false, if the assert should be ignored.
int MyICJI::doAssert(const char* szFile, int iLine, const char* szExpr)
{
jitInstance->mc->cr->AddCall("doAssert");
return param.result;
}
-// Reset JitConfig, that stores Enviroment variables.
+// Reset JitConfig, that stores Environment variables.
bool JitInstance::resetConfig(MethodContext* firstContext)
{
if (pnjitStartup == nullptr)
{
if (!jit->resetConfig(mc))
{
- LogError("JIT can't reset enviroment");
+ LogError("JIT can't reset environment");
}
if (o.nameOfJit2 != nullptr)
{
if (!jit2->resetConfig(mc))
{
- LogError("JIT2 can't reset enviroment");
+ LogError("JIT2 can't reset environment");
}
}
}
}
#ifdef HAS_ADDRESS_SANITIZER
-// use the functionality from address santizier (which does not throw exceptions)
+// use the functionality from address sanitizer (which does not throw exceptions)
#else
#define CLRThrowsExceptionWorker() RealCLRThrowsExceptionWorker(__FUNCTION__, __FILE__, __LINE__)
const NoThrow nothrow = { 0 };
#if defined(HAS_ADDRESS_SANITIZER) || defined(DACCESS_COMPILE)
-// use standard heap functions for address santizier
+// use standard heap functions for address sanitizer
#else
#ifdef _DEBUG
void * __cdecl operator new(size_t n, const NoThrow&) NOEXCEPT
{
#if defined(HAS_ADDRESS_SANITIZER) || defined(DACCESS_COMPILE)
- // use standard heap functions for address santizier (which doesn't provide for NoThrow)
+ // use standard heap functions for address sanitizer (which doesn't provide for NoThrow)
void * result = operator new(n);
#else
STATIC_CONTRACT_NOTHROW;
void * __cdecl operator new[](size_t n, const NoThrow&) NOEXCEPT
{
#if defined(HAS_ADDRESS_SANITIZER) || defined(DACCESS_COMPILE)
- // use standard heap functions for address santizier (which doesn't provide for NoThrow)
+ // use standard heap functions for address sanitizer (which doesn't provide for NoThrow)
void * result = operator new[](n);
#else
STATIC_CONTRACT_NOTHROW;
}
#if defined(HAS_ADDRESS_SANITIZER) || defined(DACCESS_COMPILE)
-// use standard heap functions for address santizier
+// use standard heap functions for address sanitizer
#else
void __cdecl
operator delete(void *p) NOEXCEPT
CONTRACT_CHECK_END;
//
- // Incrementaly validate that the entire IL method body is within the bounds of the image
+ // Incrementally validate that the entire IL method body is within the bounds of the image
//
// We need to have at least the tiny header
// Optional sections following the code
//
- for (;;)
+ while (true)
{
CHECK(CheckRva(rva, UINT32(pSect - pIL) + sizeof(IMAGE_COR_ILMETHOD_SECT_SMALL)));
// DACized copy of code:COR_ILMETHOD_FAT::GetSect
TADDR pSect = AlignUp(pIL + codeEnd, 4);
- for (;;)
+ while (true)
{
PTR_COR_ILMETHOD_SECT_SMALL pSectSmall = PTR_COR_ILMETHOD_SECT_SMALL(pSect);
#define HAS_THISPTR_RETBUF_PRECODE 1
#define CODE_SIZE_ALIGN 16 // must alloc code blocks on 8-byte boundaries; for perf reasons we use 16 byte boundaries
-#define CACHE_LINE_SIZE 64 // Current AMD64 processors have 64-byte cache lines as per AMD64 optmization manual
+#define CACHE_LINE_SIZE 64 // Current AMD64 processors have 64-byte cache lines as per AMD64 optimization manual
#define LOG2SLOT LOG2_PTRSIZE
*/
//
-//
-
#include "common.h"
#include "frames.h"
#include "exceptionhandling.h"
#include "virtualcallstub.h"
-
-
#if !defined(DACCESS_COMPILE)
VOID ResetCurrentContext()
// that the debugger is attched when we get here.
_ASSERTE(CORDebuggerAttached());
- LOG((LF_CORDB, LL_EVERYTHING, "RVU_CBSW: in RtlVitualUnwind_ClrDbgSafeWorker, ControlPc=0x%p\n", ControlPc));
+ LOG((LF_CORDB, LL_EVERYTHING, "RVU_CBSW: in RtlVirtualUnwind_ClrDbgSafeWorker, ControlPc=0x%p\n", ControlPc));
BOOL InEpilogue = FALSE;
BOOL HasManagedBreakpoint = FALSE;
return FALSE;
}
- PCODE callsite = *dac_cast<PTR_PCODE>(GetSP(pContext));
+ PCODE callsite = *dac_cast<PTR_PCODE>(GetSP(pContext));
if (pExceptionRecord != NULL)
{
pExceptionRecord->ExceptionAddress = (PVOID)callsite;
}
#endif
-
}
-
-
-
-
//
// Assembly loading:
//
// this constraint is expected and can be dealt with.
//
// Note that there is one case where this still doesn't handle recursion, and that is the
-// security subsytem. The security system runs managed code, and thus must typically fully
+// security subsystem. The security system runs managed code, and thus must typically fully
// initialize assemblies of permission sets it is trying to use. (And of course, these may be used
// while those assemblies are initializing.) This is dealt with in the historical manner - namely
// the security system passes in a special flag which says that it will deal with null return values
}
else
{
- // OK if we have have a matching PEAssembly
+ // OK if we have a matching PEAssembly
if (entry->GetFile() != NULL
&& pAssembly->GetPEAssembly()->Equals(entry->GetFile()))
{
public:
//#LoaderModule
// LoaderModule determines in which module an item gets placed.
- // For everything except paramaterized types and methods the choice is easy.
+ // For everything except parameterized types and methods the choice is easy.
//
// If NGEN'ing we may choose to place the item into the current module (which is different from runtime behavior).
//
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-// codeman.cpp - a managment class for handling multiple code managers
-//
+//
+// codeman.cpp - a managment class for handling multiple code managers
//
#include "common.h"
// Walk backwards in the RUNTIME_FUNCTION array until we find a non-fragment.
// We're guaranteed to find one, because we require that a fragment live in a function or funclet
// that has a prolog, which will have non-fragment .xdata.
- for (;;)
+ while (true)
{
if (!IsFunctionFragment(baseAddress, pRootEntry))
{
{
NewHolder<EmergencyJumpStubReserve> pNewReserve(new EmergencyJumpStubReserve());
- for (;;)
+ while (true)
{
BYTE * loAddrCurrent = loAddr;
BYTE * hiAddrCurrent = hiAddr;
CORCOMPILE_EXCEPTION_CLAUSE* pClause = &(dac_cast<PTR_CORCOMPILE_EXCEPTION_CLAUSE>(pEnumState->pExceptionClauseArray)[iCurrentPos]);
- // copy to the input parmeter, this is a nice abstraction for the future
+ // copy to the input parameter, this is a nice abstraction for the future
// if we want to compress the Clause encoding, we can do without affecting the call sites
pEHClauseOut->TryStartPC = pClause->TryStartPC;
pEHClauseOut->TryEndPC = pClause->TryEndPC;
//
// The purpose of this object is to serve as an entry point to the
-// debugger, which used to reside in a seperate DLL.
+// debugger, which used to reside in a separate DLL.
//
class DebugInterface
* Last chance for the runtime support to do fixups in the context
* before execution continues inside an EnC updated function.
* It also adjusts ESP and munges on the stack. So the caller has to make
- * sure that that stack region isnt needed (by doing a localloc)
+ * sure that this stack region is not needed (by doing a localloc).
* Also, if this returns EnC_FAIL, we should not have munged the
* context ie. transcated commit
* The plan of attack is:
* in order to adjust ESP.
*
* Note that we report "this" for all methods, even if
- * noncontinuable, because because of the off chance they may be
+ * noncontinuable, because of the off chance they may be
* synchronized and we have to release the monitor on unwind. This
* could conceivably be optimized, but it turns out to be more
* expensive to check whether we're synchronized (which involves
// Reset any flags relevant to the old code
//
- // Note that this only works since we've very carefullly made sure that _all_ references
+ // Note that this only works since we've very carefully made sure that _all_ references
// to the Method's code must be to the call/jmp blob immediately in front of the
// MethodDesc itself. See MethodDesc::IsEnCMethod()
//
CONTRACTL
{
// Since this function will modify the scanned stack range, which is also accessed during the GC stackwalk,
- // we invoke it in COOP mode so that that access to the range is synchronized.
+ // we invoke it in COOP mode so that the access to this range is synchronized.
MODE_COOPERATIVE;
GC_TRIGGERS;
THROWS;
CONTRACTL
{
// Since this function can modify the scanned stack range, which is also accessed during the GC stackwalk,
- // we invoke it in COOP mode so that that access to the range is synchronized.
+ // we invoke it in COOP mode so that the access to this range is synchronized.
MODE_COOPERATIVE;
GC_NOTRIGGER;
NOTHROW;
//==========================================================================
-// Helpful macros to declare exception handlers, their implementaiton,
+// Helpful macros to declare exception handlers, their implementation,
// and to call them.
//==========================================================================
}
};
-/* Buid the source files table for DWARF source line info */
+/* Build the source files table for DWARF source line info */
bool NotifyGdb::BuildFileTable(MemBuf& buf, SymbolsInfo* lines, unsigned nlines, const char * &cuPath)
{
FileTableBuilder fileTable(nlines);
EEToProfilerExceptionInterfaceWrapper::ExceptionCatcherLeave();
// no need to set pExInfo->m_ClauseType = (DWORD)COR_PRF_CLAUSE_NONE now that the
- // notification is done because because the ExInfo record is about to be popped off anyway
+ // notification is done because the ExInfo record is about to be popped off anyway
LOG((LF_EH, LL_INFO1000, "COMPlusPEndCatch:pThread:0x%x\n",pThread));
// will not be available. Thus, we should reset the severity only if its not such a thread.
//
// This behaviour (of debugger doing SetIP) is not allowed on 64bit since the catch clauses are implemented
- // as a seperate funclet and it's just not allowed to set the IP across EH scopes, such as from inside a catch
+ // as a separate funclet and it's just not allowed to set the IP across EH scopes, such as from inside a catch
// clause to outside of the catch clause.
bool fIsDebuggerHelperThread = (g_pDebugInterface == NULL) ? false : g_pDebugInterface->ThisIsHelperThread();
// Separate the wrapper from the tracker runtime prior to
// passing them onto the caller. This call is okay to make
// even if the instance isn't from the tracker runtime.
- // We switch to Preemptive mode since seperating a wrapper
+ // We switch to Preemptive mode since separating a wrapper
// requires us to call out to non-runtime code which could
// call back into the runtime and/or trigger a GC.
GCX_PREEMP();
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-
-
#include "common.h"
#include "jitinterface.h"
#include "codeman.h"
}
pDeclaringMT = pMT;
- for (;;)
+ while (true)
{
MethodTable * pParentMT = pDeclaringMT->GetParentMethodTable();
if (pParentMT->GetNumDicts() <= dictionaryIndex)
switch (jitHelperLoggingLevel)
{
case 1:
- // This will print a comma seperated list:
+ // This will print a comma separated list:
// CORINFO_XXX_HELPER, 10
// CORINFO_YYYY_HELPER, 11
STRESS_LOG2(logFacility, logLevel, "%s, %d\n", name, count);
//
// Scan chain of parent types
//
- for (;;)
+ while (true)
{
Module * pDefModule = pMT->GetModule();
if (pDefModule->IsSystem())
MODE_PREEMPTIVE;
} CONTRACTL_END;
- // <REVISIT_TODO>@todo FIX need to really fetch the class atributes. at present
+ // <REVISIT_TODO>@todo FIX need to really fetch the class attributes. at present
// we don't need to because the JIT only cares in the case of COM classes</REVISIT_TODO>
uint32_t ret = 0;
_ASSERTE(merged == reflexive);
}
- //If both sides are arrays, then the result is either an array or g_pArrayClass. The above is
- //actually true about the element type for references types, but I think that that is a little
- //excessive for sanity.
+ // If both sides are arrays, then the result is either an array or g_pArrayClass. The above is
+ // actually true for reference types as well, but it is a little excessive to deal with.
if (hnd1.IsArray() && hnd2.IsArray())
{
_ASSERTE((merged.IsArray() && reflexive.IsArray())
// Either
// 1. no constraint resolution at compile time (!directMethod)
// OR 2. no code sharing lookup in call
- // OR 3. we have have resolved to an instantiating stub
+ // OR 3. we have resolved to an instantiating stub
pMDAfterConstraintResolution = directMethod;
_ASSERTE(!pMDAfterConstraintResolution->IsInterface());
#endif // defined(TARGET_AMD64) || defined(TARGET_ARM64)
- for (;;)
+ while (true)
{
CEEJitInfo jitInfo(ftn, ILHeader, jitMgr, !flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_NO_INLINING));
continue;
}
- // Find only the constructor for for this object
+ // Find only the constructor for this object
_ASSERTE(pCurMethod->GetMethodTable() == pMT->GetCanonicalMethodTable());
PCCOR_SIGNATURE pCurMethodSig;
public:
// True iff it is possible to change the code this method will run using the CodeVersionManager. Note: EnC currently returns
- // false here because it uses its own seperate scheme to manage versionability. We will likely want to converge them at some
+ // false here because it uses its own separate scheme to manage versionability. We will likely want to converge them at some
// point.
bool IsVersionable()
{
enum {
enum_flag_TokenRangeMask = 0x07FF, // This must equal METHOD_TOKEN_RANGE_MASK calculated higher in this file
- // These are seperate to allow the flags space available and used to be obvious here
+ // These are separate to allow the flags space available and used to be obvious here
// and for the logic that splits the token to be algorithmically generated based on the
// #define
enum_flag_HasCompactEntrypoints = 0x4000, // Compact temporary entry points
// we will put a catchall "break" here which will cause the typeload to abort (albeit with a probably misleading
// error message.)
break;
- } // for(;;)
+ }
// We only break out of the loop above if we detected an error.
if (i < bmtMetaData->cFields || !explicitClassTrust.IsLegal())
{
//#LoadExactInterfaceMap_Algorithm2
// Exact interface instantiation loading TECHNIQUE 2 - The exact instantiation has caused some duplicates to
- // appear in the interface map! This may not be an error: if the duplicates
- // were ones that arose because because of inheritance from
- // a parent type then we accept that. For example
+ // appear in the interface map! This may not be an error: if the duplicates were ones that arose because of
+ // inheritance from a parent type then we accept that. For example
// class C<T> : I<T>
// class D<T> : C<T>, I<string>
// is acceptable even when loading D<string>. Note that in such a case
// Compare original and duplicate interface entries in the dispatch map if they contain
// different implementation for the same interface method
- for (;;)
+ while (true)
{
if (!originalIt.IsValid() || !duplicateIt.IsValid())
{ // We reached end of one dispatch map iterator
//
// ===========================================================================
-// This file contains the implementation for MultiCore JIT (player in a seperate file MultiCoreJITPlayer.cpp)
+// This file contains the implementation for MultiCore JIT (player in a separate file MultiCoreJITPlayer.cpp)
// ===========================================================================
//
{
m_fullFileName = pRoot;
- // Append seperator if root does not end with one
+ // Append separator if root does not end with one
unsigned len = m_fullFileName.GetCount();
if ((len != 0) && (m_fullFileName[len - 1] != '\\'))
// Definitions of a Com+ Object
//
-
-
#include "common.h"
#include "vars.hpp"
unsigned charA;
unsigned charB;
- for(;;) {
+ while (true)
+ {
charA = *strAChars;
charB = (unsigned) *strBChars;
{
// REVISIT_TODO: Weakening the contract system a little bit here. We should really
// add a special NULLOBJECTREF which can be used for these situations and have
- // a seperate code path for that with the correct contract protections.
+ // a separate code path for that with the correct contract protections.
STATIC_CONTRACT_VIOLATION(ModeViolation);
VALIDATEOBJECT(objref.m_asObj);
{
// REVISIT_TODO: Weakening the contract system a little bit here. We should really
// add a special NULLOBJECTREF which can be used for these situations and have
- // a seperate code path for that with the correct contract protections.
+ // a separate code path for that with the correct contract protections.
STATIC_CONTRACT_VIOLATION(ModeViolation);
VALIDATEOBJECT(objref.m_asObj);
// m_object - a field that has a reference type in it. Used only for RuntimeMethodInfoStub to keep the real type alive.
// This structure matches the structure up to the m_pMD for several different managed types.
// (RuntimeConstructorInfo, RuntimeMethodInfo, and RuntimeMethodInfoStub). These types are unrelated in the type
-// system except that they all implement a particular interface. It is important that that interface is not attached to any
+// system except that they all implement a particular interface. It is important that such interface is not attached to any
// type that does not sufficiently match this data structure.
class ReflectMethodObject : public BaseObjectWithCachedData
{
// m_object - a field that has a reference type in it. Used only for RuntimeFieldInfoStub to keep the real type alive.
// This structure matches the structure up to the m_pFD for several different managed types.
// (RtFieldInfo and RuntimeFieldInfoStub). These types are unrelated in the type
-// system except that they all implement a particular interface. It is important that that interface is not attached to any
+// system except that they all implement a particular interface. It is important that such interface is not attached to any
// type that does not sufficiently match this data structure.
class ReflectFieldObject : public BaseObjectWithCachedData
{
// This just gets the image headers into the dump.
// This is used, for example, for ngen images to ensure we have the debug directory so we
// can find the managed PDBs.
- // No lock here as the processs should be suspended.
+ // No lock here as the process should be suspended.
if (m_pLayouts[IMAGE_FLAT].IsValid() && m_pLayouts[IMAGE_FLAT]!=NULL)
m_pLayouts[IMAGE_FLAT]->EnumMemoryRegions(flags);
if (m_pLayouts[IMAGE_LOADED].IsValid() && m_pLayouts[IMAGE_LOADED]!=NULL)
// <TODO> FIX IN BETA 2
//
// g_pNotificationTable is only modified by the DAC and therefore the
-// optmizer can assume that it will always be its default value and has
+// optimizer can assume that it will always be its default value and has
// been seen to (on IA64 free builds) eliminate the code in DACNotifyCompilationFinished
// such that DAC notifications are no longer sent.
//
if (pAssemblyId != NULL)
{
// Lie and say the assembly isn't available until we are loaded (even though it is.)
- // This is for backward compatibilty - we may want to change it
+ // This is for backward compatibility - we may want to change it
if (pModule->IsProfilerNotified())
{
Assembly *pAssembly = pModule->GetAssembly();
// if we're currently in a SendMessage.
// Also, clients can opt out of this. The option is a per-thread flag which they can
// set by calling DisableComEagerCleanup on the appropriate thread. Why would they
- // want to opt out? Because pumping can lead to re-entrancy in in unexpected places.
+ // want to opt out? Because pumping can lead to re-entrancy in unexpected places.
// If a client decides to opt out, they are required to cleanup RCWs themselves by
// calling Marshal.CleanupUnusedObjectsInCurrentContext periodically. The best place
// to make that call is within their own message pump.
}
CONTRACTL_END;
- // Allow addrefs to go through, coz we are allowing
+ // Allow addrefs to go through, because we are allowing
// all releases to go through, otherwise we would
// have a mismatch of ref-counts
return Unknown_AddRef_Internal(pUnk);
}
CONTRACTL_END;
- // Allow addrefs to go through, coz we are allowing
+ // Allow addrefs to go through, because we are allowing
// all releases to go through, otherwise we would
// have a mismatch of ref-counts
return Unknown_AddRefInner_Internal(pUnk);
}
CONTRACTL_END;
- // Allow addrefs to go through, coz we are allowing
+ // Allow addrefs to go through, because we are allowing
// all releases to go through, otherwise we would
// have a mismatch of ref-counts
return Unknown_AddRefSpecial_Internal(pUnk);
// We do need to take the globalstringliteralmap lock because we are manipulating
// StringLiteralEntry objects that belong to it.
- // Note that we remember the current entry and relaese it only when the
+ // Note that we remember the current entry and release it only when the
// enumerator has advanced to the next entry so that we don't endup deleteing the
// current entry itself and killing the enumerator.
//
//
// UINT RRT.GetSizeOfData(refsize, variationCode)
-// Returns the total size of the seperate data area (if any) that the
+// Returns the total size of the separate data area (if any) that the
// instruction needs in bytes for a given refsize. For this example
// on the SH3
// if (refsize==k32) return 4; else return 0;
//
// The default implem of this returns 0, so CPUs that don't have need
-// for a seperate constant area don't have to worry about it.
+// for a separate constant area don't have to worry about it.
//
//
// BOOL CanReach(refsize, variationcode, fExternal, offset)
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-//
-// THREADS.CPP
-//
//
+// THREADS.CPP
//
-
#include "common.h"
#include "frames.h"
UINT_PTR uPrevControlPc = uControlPc;
- for (;;)
+ while (true)
{
RtlLookupFunctionEntry(uControlPc,
ARM_ONLY((DWORD*))(&uImageBase),
#ifdef TARGET_X86
// Find the stop point (most jitted function)
Frame* pFrame = pThread->GetFrame();
- for(;;)
+ while (true)
{
// skip GC frames
if (pFrame == 0 || pFrame == (Frame*) -1)
if (!IsAddressInStack(currentSP))
{
- _ASSERTE(!"Target stack has been corrupted, SP must in in the stack range.");
+ _ASSERTE(!"Target stack has been corrupted, SP must be in the stack range.");
break;
}
}
// Clears the table. Useful to do when crossing the managed-code - EE boundary
- // as you ususally only care about OBJECTREFS that have been created after that
+ // as you usually only care about OBJECTREFS that have been created after that
static void STDCALL ObjectRefFlush(Thread* thread);
DWORD dwSwitchCount = 0;
#endif // !defined(DISABLE_THREADSUSPEND)
- for (;;)
+ while (true)
{
// Lock the thread store
LOG((LF_SYNC, INFO3, "UserAbort obtain lock\n"));
}
#endif
- } // for(;;)
+ } // while (true)
if ((GetAbortEndTime() != MAXULONGLONG) && IsAbortRequested())
{
DWORD dwSwitchCount = 0;
- for (;;)
+ while (true)
{
EnablePreemptiveGC();
// We're done with our GC. Let all the threads run again.
// By this point we've already unblocked most threads. This just releases the ThreadStore lock.
-void ThreadSuspend::ResumeRuntime(BOOL bFinishedGC, BOOL SuspendSucceded)
+void ThreadSuspend::ResumeRuntime(BOOL bFinishedGC, BOOL SuspendSucceeded)
{
CONTRACTL {
NOTHROW;
_ASSERTE(IsGCSpecialThread() || ThreadStore::HoldingThreadStore());
_ASSERTE(!GCHeapUtilities::IsGCInProgress() );
- STRESS_LOG2(LF_SYNC, LL_INFO1000, "Thread::ResumeRuntime(finishedGC=%d, SuspendSucceeded=%d) - Start\n", bFinishedGC, SuspendSucceded);
+ STRESS_LOG2(LF_SYNC, LL_INFO1000, "Thread::ResumeRuntime(finishedGC=%d, SuspendSucceeded=%d) - Start\n", bFinishedGC, SuspendSucceeded);
//
// Notify everyone who cares, that this suspension is over, and this thread is going to go do other things.
//----------------------------------------------------------------------------
-void ThreadSuspend::RestartEE(BOOL bFinishedGC, BOOL SuspendSucceded)
+void ThreadSuspend::RestartEE(BOOL bFinishedGC, BOOL SuspendSucceeded)
{
ThreadSuspend::s_fSuspended = false;
#ifdef TIME_SUSPEND
Thread *thread = NULL;
while ((thread = ThreadStore::GetThreadList(thread)) != NULL)
{
- thread->PrepareForEERestart(SuspendSucceded);
+ thread->PrepareForEERestart(SuspendSucceeded);
}
//
GCHeapUtilities::GetGCHeap()->SetWaitForGCEvent();
_ASSERTE(IsGCSpecialThread() || ThreadStore::HoldingThreadStore());
- ResumeRuntime(bFinishedGC, SuspendSucceded);
+ ResumeRuntime(bFinishedGC, SuspendSucceeded);
FireEtwGCRestartEEEnd_V1(GetClrInstanceId());
static SUSPEND_REASON m_suspendReason; // This contains the reason why the runtime is suspended
static void SuspendRuntime(ThreadSuspend::SUSPEND_REASON reason);
- static void ResumeRuntime(BOOL bFinishedGC, BOOL SuspendSucceded);
+ static void ResumeRuntime(BOOL bFinishedGC, BOOL SuspendSucceeded);
public:
// Initialize thread suspension support
static void Initialize();
public:
//suspend all threads
static void SuspendEE(SUSPEND_REASON reason);
- static void RestartEE(BOOL bFinishedGC, BOOL SuspendSucceded); //resume threads.
+ static void RestartEE(BOOL bFinishedGC, BOOL SuspendSucceeded); //resume threads.
static void LockThreadStore(ThreadSuspend::SUSPEND_REASON reason);
static void UnlockThreadStore(BOOL bThreadDestroyed = FALSE,
}
}
-// Dequeues the next method in the optmization queue.
+// Dequeues the next method in the optimization queue.
// This runs on the background thread.
NativeCodeVersion TieredCompilationManager::GetNextMethodToOptimize()
{
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+
//
// File: typedesc.cpp
-//
-
-
//
// This file contains definitions for methods in the code:TypeDesc class and its
// subclasses
// code:ParamTypeDesc,
// code:TyVarTypeDesc,
// code:FnPtrTypeDesc
-//
-
//
// ============================================================================
if (numConstraints != 0)
{
LoaderAllocator* pAllocator = GetModule()->GetLoaderAllocator();
- // If there is a single class constraint we put in in element 0 of the array
+ // If there is a single class constraint we place it at index 0 of the array
AllocMemHolder<TypeHandle> constraints
(pAllocator->GetLowFrequencyHeap()->AllocMem(S_SIZE_T(numConstraints) * S_SIZE_T(sizeof(TypeHandle))));
// <TODO> FIX IN BETA 2
//
// g_dacNotificationFlags is only modified by the DAC and therefore the
-// optmizer can assume that it will always be its default value and has
+// optimizer can assume that it will always be its default value and has
// been seen to eliminate the code in DoModuleLoadNotification,
// etc... such that DAC notifications are no longer sent.
//
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+
//
// File: VirtualCallStub.h
-//
-
-
-
//
// See code:VirtualCallStubManager for details
//
#ifndef _VIRTUAL_CALL_STUB_H
#define _VIRTUAL_CALL_STUB_H
-
#define CHAIN_LOOKUP
#if defined(TARGET_X86)
it is not in use. It also implies that internal table structures, such as discarded hash table buckets,
cannot be freely recycled since another concurrent thread may still be walking thru it.
-4. Occassionaly it is necessary to pick up the pieces that have been dropped on the floor
+4. Occassionally it is necessary to pick up the pieces that have been dropped on the floor
so to speak, e.g. actually recycle hash buckets that aren't in use. Since we have a natural
sync point already in the GC, we use that to provide cleanup points. We need to make sure that code that
is walking our structures is not a GC safe point. Hence if the GC calls back into us inside the GC
while (currentIndex < data.Length);
// If a header range was set, but the value was not in the data, then copy the range
- // to the name buffer. Must copy because because the data will be replaced and the range
+ // to the name buffer. Must copy because the data will be replaced and the range
// will no longer be valid.
if (_headerNameRange != null)
{
while (currentIndex < data.Length);
// If a header range was set, but the value was not in the data, then copy the range
- // to the name buffer. Must copy because because the data will be replaced and the range
+ // to the name buffer. Must copy because the data will be replaced and the range
// will no longer be valid.
if (_headerNameRange != null)
{
if (expectException)
continue;
- throw new XunitException($"An unexpected error occured while decompressing data:{e}");
+ throw new XunitException($"An unexpected error occurred while decompressing data:{e}");
}
if (expectException)
# Firewall configuration
$script:firewallGroup = "Libraries Testing"
$script:firewallRules = @(
- @{Name = "LibariesNet - HTTP 80"; Port = 80},
+ @{Name = "LibrariesNet - HTTP 80"; Port = 80},
@{Name = "LibrariesNet - HTTP 443"; Port = 443}
)
using Aes = System.Security.Cryptography.Aes;
[SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")]
- public static class DecryptorReusabilty
+ public static class DecryptorReusability
{
// See https://github.com/dotnet/runtime/issues/21354 for details
[ConditionalFact(nameof(ShouldDecryptorBeReusable))]
{
CKeywordParser.Tokens tokens = new CKeywordParser.Tokens();
tokens.Equal = " ";
- tokens.Seperator = "/";
+ tokens.Separator = "/";
s_hashOptions = CKeywordParser.ParseKeywords(CommandLine, tokens);
}
return s_hashOptions;
public class Tokens
{
public string Equal = "=";
- public string Seperator = ";";
+ public string Separator = ";";
public string SingleQuote = "'";
public string DoubleQuote = "\"";
};
{
state = PARSE.DoubleBegin;
}
- else if (tokens.Seperator.IndexOf(ch) >= 0)
+ else if (tokens.Separator.IndexOf(ch) >= 0)
{
keywords[key] = string.Empty;
state = PARSE.Initial;
break;
case PARSE.Value:
- if (tokens.Seperator.IndexOf(ch) >= 0)
+ if (tokens.Separator.IndexOf(ch) >= 0)
{
keywords[key] = (builder.ToString()).Trim();
state = PARSE.Initial;
break;
case PARSE.End:
- if (tokens.Seperator.IndexOf(ch) >= 0)
+ if (tokens.Separator.IndexOf(ch) >= 0)
{
state = PARSE.Initial;
}
+++ /dev/null
-<Project Sdk="Microsoft.NET.Sdk">
-
- <PropertyGroup>
- <TargetFrameworks>$(NetCoreAppCurrent);$(NetFrameworkMinimum)</TargetFrameworks>
- <EnableDefaultItems>true</EnableDefaultItems>
- <OutputType>Exe</OutputType>
- </PropertyGroup>
-
- <ItemGroup>
- <ProjectReference Include="..\MockHostTypes\MockHostTypes.csproj" />
- </ItemGroup>
-
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.Hosting;
-
-var host = new HostBuilder().ConfigureAppConfiguration(builder => builder.AddCommandLine(args)).Build();
\ No newline at end of file
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFrameworks>$(NetCoreAppCurrent);$(NetFrameworkMinimum)</TargetFrameworks>
+ <EnableDefaultItems>true</EnableDefaultItems>
+ <OutputType>Exe</OutputType>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\MockHostTypes\MockHostTypes.csproj" />
+ </ItemGroup>
+
+</Project>
--- /dev/null
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Hosting;
+
+var host = new HostBuilder().ConfigureAppConfiguration(builder => builder.AddCommandLine(args)).Build();
\ No newline at end of file
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
- public void ApplicationNameSetFromAgrument()
+ public void ApplicationNameSetFromArgument()
{
- Assembly assembly = Assembly.Load("ApplicationNameSetFromAgrument");
+ Assembly assembly = Assembly.Load("ApplicationNameSetFromArgument");
var factory = HostFactoryResolver.ResolveServiceProviderFactory(assembly, s_WaitTimeout);
IServiceProvider? serviceProvider = factory(Array.Empty<string>());
var configuration = (IConfiguration)serviceProvider.GetService(typeof(IConfiguration));
- Assert.Contains("ApplicationNameSetFromAgrument", configuration["applicationName"]);
+ Assert.Contains("ApplicationNameSetFromArgument", configuration["applicationName"]);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="ApplicationNameSetFromAgrument\ApplicationNameSetFromAgrument.csproj" />
+ <ProjectReference Include="ApplicationNameSetFromArgument\ApplicationNameSetFromArgument.csproj" />
<ProjectReference Include="BuildWebHostInvalidSignature\BuildWebHostInvalidSignature.csproj" />
<ProjectReference Include="BuildWebHostPatternTestSite\BuildWebHostPatternTestSite.csproj" />
<ProjectReference Include="CreateHostBuilderInvalidSignature\CreateHostBuilderInvalidSignature.csproj" />
Assert.False(factory.CleanupTimerStarted.IsSet, "Cleanup timer not started");
}
- // Seprate to avoid the HttpClient getting its lifetime extended by
+ // Separate to avoid the HttpClient getting its lifetime extended by
// the state machine of the test.
[MethodImpl(MethodImplOptions.NoInlining)]
private async Task<ExpiredHandlerTrackingEntry> SimulateClientUse_Factory_CleanupCycle_DisposesEligibleHandler(TestHttpClientFactory factory)
Assert.False(factory.CleanupTimerStarted.IsSet, "Cleanup timer not started");
}
- // Seprate to avoid the HttpClient getting its lifetime extended by
+ // Separate to avoid the HttpClient getting its lifetime extended by
// the state machine of the test.
[MethodImpl(MethodImplOptions.NoInlining)]
private async Task<ExpiredHandlerTrackingEntry> SimulateClientUse_Factory_CleanupCycle_DisposesLiveHandler(
namespace Microsoft.Extensions.Options.ConfigurationExtensions.Tests
{
- public class OptionsBuidlerConfigurationExtensionsTests
+ public class OptionsBuilderConfigurationExtensionsTests
{
[Fact]
public static void BindConfiguration_ThrowsForNullBuilder()
' as well as skipping over quotations used around embedded spaces within
' the application name
' examples:
- ' f:\"Program Files"\Microsoft\foo.exe a b d e f
- ' "f:\"Program Files"\Microsoft\foo.exe" a b d e f
- ' f:\Program Files\Microsoft\foo.exe a b d e f
+ ' f:\"Program Files"\Microsoft\foo.exe a b d e f
+ ' "f:\"Program Files"\Microsoft\foo.exe" a b d e f
+ ' f:\Program Files\Microsoft\foo.exe a b d e f
Dim LengthOfAppName, j As Integer
'Remove the app name from the arguments
'============================================================================
Public Function Choose(ByVal Index As Double, ByVal ParamArray Choice() As Object) As Object
- Dim FixedIndex As Integer = CInt(Fix(Index) - 1) 'ParamArray is 0 based, but Choose assumes 1 based
+ Dim FixedIndex As Integer = CInt(Fix(Index) - 1) 'ParamArray is 0 based, but Choose assumes 1 based
If Choice.Rank <> 1 Then
Throw New ArgumentException(SR.Format(SR.Argument_RankEQOne1, "Choice"))
End If
'Build-up the string. Calculate number of spaces needed: VB3 uses Stop + 1.
- 'This may seem bogus but it has to be this way for VB3 compatibilty.
+ 'This may seem bogus but it has to be this way for VB3 compatibility.
Buffer1 = CStr([Stop] + 1)
Buffer2 = CStr(Start - 1)
InsertNumber(Buffer, Lower, Spaces)
End If
- 'Insert the partition
+ 'Insert the partition
Buffer = Buffer & ":"
'Insert upper-end of partition range
Output.Write(')');
}
- // In VB, constraints are put right after the type paramater name.
+ // In VB, constraints are put right after the type parameter name.
// In C#, there is a separate "where" statement
private void OutputTypeParameterConstraints(CodeTypeParameter typeParameter)
{
/// <summary>
/// Implementation of IComposablePartTraversal supporting the Dependents traveral pattern.
/// The implementation is optimized for a situation when the traversal is expected to be rather short-lived - that is,
- /// if the chains of dependecies are rather small. To achieve that we do a very minimal structure prep upfront - merely creating a contract-based
+ /// if the chains of dependencies are rather small. To achieve that we do a very minimal structure prep upfront - merely creating a contract-based
/// index of imports - and the verify the full match of imports during the traversal. Given that most parts have a very few imports this should perform well.
/// </summary>
internal sealed class DependentsTraversal : IComposablePartCatalogTraversal
public partial class FilteredCatalog
{
/// <summary>
- /// Creates a new instance of the <see cref="FilteredCatalog"/> that conatains all the parts from the orignal filtered catalog and all their dependecies.
+ /// Creates a new instance of the <see cref="FilteredCatalog"/> that conatains all the parts from the orignal filtered catalog and all their dependencies.
/// </summary>
/// <returns></returns>
public FilteredCatalog IncludeDependencies()
}
[Fact]
- public void CreatePart_From_InvalidPartDefiniton_ShouldThrowArgumentException()
+ public void CreatePart_From_InvalidPartDefinition_ShouldThrowArgumentException()
{
Assert.Throws<ArgumentException>("partDefinition", () =>
{
}
[Fact]
- public void IsMultiple_ValueAsValueArgument_ShouldSetPropert()
+ public void IsMultiple_ValueAsValueArgument_ShouldSetProperty()
{
var expectations = Expectations.GetBooleans();
}
//=========================================================================================================================================
- // Test cases for AssemblyCatalog(string codebase, ICompositionElement definitonOrigin) constructor
+ // Test cases for AssemblyCatalog(string codebase, ICompositionElement definitionOrigin) constructor
//=========================================================================================================================================
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/24240")]
}
//=========================================================================================================================================
- // Test cases for AssemblyCatalog(string codebase, ICompositionElement definitonOrigin, ReflectionContext reflectionContext) constructor
+ // Test cases for AssemblyCatalog(string codebase, ICompositionElement definitionOrigin, ReflectionContext reflectionContext) constructor
//=========================================================================================================================================
[Fact]
public void Constructor4_ValueAsCodebaseArgument_ShouldSetAssemblyProperty()
});
}
//=========================================================================================================================================
- // Test cases for AssemblyCatalog(string codebase, ICompositionElement definitonOrigin) constructor
+ // Test cases for AssemblyCatalog(string codebase, ICompositionElement definitionOrigin) constructor
//=========================================================================================================================================
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/24240")]
}
//=========================================================================================================================================
- // Test cases for AssemblyCatalog(string codebase, ICompositionElement definitonOrigin, ReflectionContext reflectionContext) constructor
+ // Test cases for AssemblyCatalog(string codebase, ICompositionElement definitionOrigin, ReflectionContext reflectionContext) constructor
//=========================================================================================================================================
[Fact]
public void Constructor8_ValueAsAssemblyArgument_ShouldSetAssemblyProperty()
}
[Fact]
- public void CreateImportDefinition_Parameter_NullAsParamater_ShouldThrowArgumentNull()
+ public void CreateImportDefinition_Parameter_NullAsParameter_ShouldThrowArgumentNull()
{
ParameterInfo parameter = typeof(TestPart).GetConstructor(new Type[] { typeof(int) }).GetParameters()[0];
Lazy<ParameterInfo> expectedLazyParameter = parameter.AsLazy();
}
[Fact]
- public void PartTypeLoadedLazilyEagerDependeciesLoadEagerly()
+ public void PartTypeLoadedLazilyEagerDependenciesLoadEagerly()
{
var catalog = new TypeLoadNotifyingCatalog(typeof(ExportingPart), typeof(PartImportingEagerly));
var container = new CompositionContainer(catalog);
}
[Fact]
- public void PartTypeLoadedLazilyLazyDependeciesLoadLazily()
+ public void PartTypeLoadedLazilyLazyDependenciesLoadLazily()
{
var catalog = new TypeLoadNotifyingCatalog(typeof(ExportingPart), typeof(PartImportingLazily));
var container = new CompositionContainer(catalog);
}
[Fact]
- public void PartTypeLoadedLazilyEagerCollectionDependeciesLoadEagerly()
+ public void PartTypeLoadedLazilyEagerCollectionDependenciesLoadEagerly()
{
var catalog = new TypeLoadNotifyingCatalog(typeof(ExportingPart), typeof(PartImportingCollectionEagerly));
var container = new CompositionContainer(catalog);
}
[Fact]
- public void PartTypeLoadedLazilyLazyCollectionDependeciesLoadLazily()
+ public void PartTypeLoadedLazilyLazyCollectionDependenciesLoadLazily()
{
var catalog = new TypeLoadNotifyingCatalog(typeof(ExportingPart), typeof(PartImportingCollectionLazily));
var container = new CompositionContainer(catalog);
private static readonly int s_bitAmbientValueQueried = InterlockedBitVector32.CreateMask(s_bitReadOnlyChecked);
private static readonly int s_bitSetOnDemand = InterlockedBitVector32.CreateMask(s_bitAmbientValueQueried);
- private InterlockedBitVector32 _state; // Contains the state bits for this proeprty descriptor.
+ private InterlockedBitVector32 _state; // Contains the state bits for this property descriptor.
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
private readonly Type _componentClass; // used to determine if we should all on us or on the designer
private readonly Type _type; // the data type of the property
public void VerifyAssemblyNameCanBeUsedWithContainer()
{
var test = new ContainerConfiguration()
- .WithAssembly(typeof(ClassWithDependecy).GetTypeInfo().Assembly)
+ .WithAssembly(typeof(ClassWithDependency).GetTypeInfo().Assembly)
.CreateContainer();
- var b = test.GetExport<ClassWithDependecy>();
+ var b = test.GetExport<ClassWithDependency>();
Assert.NotNull(b);
Assert.NotNull(b._dep);
}
public void VerifyAssemblyWithTwoBaseTypeWithOnlyOneExportedWorks()
{
var test = new ContainerConfiguration()
- .WithAssembly(typeof(ClassWithDependecy).GetTypeInfo().Assembly)
+ .WithAssembly(typeof(ClassWithDependency).GetTypeInfo().Assembly)
.CreateContainer();
- var b = test.GetExport<ClassWithDependecyAndSameBaseType>();
+ var b = test.GetExport<ClassWithDependencyAndSameBaseType>();
Assert.NotNull(b);
Assert.NotNull(b._dep);
Assert.Equal(typeof(TestDependency), b._dep.GetType());
namespace TestLibrary
{
[Export]
- public class ClassWithDependecy
+ public class ClassWithDependency
{
public TestDependency _dep;
[ImportingConstructor]
- public ClassWithDependecy(TestDependency dep)
+ public ClassWithDependency(TestDependency dep)
{
_dep = dep;
}
}
[Export]
- public class ClassWithDependecyAndSameBaseType
+ public class ClassWithDependencyAndSameBaseType
{
public IDependency _dep;
[ImportingConstructor]
- public ClassWithDependecyAndSameBaseType(IDependency dep)
+ public ClassWithDependencyAndSameBaseType(IDependency dep)
{
_dep = dep;
}
}
catch
{
- // Ignore the error if we are attempting to retreive
+ // Ignore the error if we are attempting to retrieve
// the last known good configuration.
if (!getLkg) throw;
}
//
// It WILL be common in web scenarios for there to be
// deep hierarchies of config files, most of which have
- // sparse input. Therefore we do not want to retreive a
+ // sparse input. Therefore we do not want to retrieve a
// factory record if it is not necessary to do so, as
// it would always lead to an order N-squared operation,
// where N is the depth of the config hierarchy.
}
catch
{
- // Ignore the error if we are attempting to retreive
+ // Ignore the error if we are attempting to retrieve
// the last known good configuration.
if (!getLkg) throw;
}
}
catch
{
- // Ignore the error if we are attempting to retreive
+ // Ignore the error if we are attempting to retrieve
// the last known good configuration.
if (!getLkg) throw;
}
<Compile Include="System\Configuration\SettingElementTests.cs" />
<Compile Include="System\Configuration\SettingsDescriptionAttributeTests.cs" />
<Compile Include="System\Configuration\SettingsGroupDescriptionAttributeTests.cs" />
- <Compile Include="System\Configuration\SettingsManageabilityAtrributeTests.cs" />
+ <Compile Include="System\Configuration\SettingsManageabilityAttributeTests.cs" />
<Compile Include="System\Configuration\SettingsPropertyIsReadOnlyExceptionTests.cs" />
<Compile Include="System\Configuration\SettingsPropertyNotFoundExceptionTests.cs" />
<Compile Include="System\Configuration\SettingsPropertyWrongTypeExceptionTests.cs" />
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using Xunit;
-
-namespace System.Configuration
-{
- public class SettingsManageabilityAtrributeTests
- {
- [Fact]
- public void GetValueIsExpected()
- {
- var testSettingManageabilityAttribute = new SettingsManageabilityAttribute(SettingsManageability.Roaming);
- Assert.Equal(SettingsManageability.Roaming, testSettingManageabilityAttribute.Manageability);
- }
- }
-}
--- /dev/null
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using Xunit;
+
+namespace System.Configuration
+{
+ public class SettingsManageabilityAttributeTests
+ {
+ [Fact]
+ public void GetValueIsExpected()
+ {
+ var testSettingManageabilityAttribute = new SettingsManageabilityAttribute(SettingsManageability.Roaming);
+ Assert.Equal(SettingsManageability.Roaming, testSettingManageabilityAttribute.Manageability);
+ }
+ }
+}
else
{
string CurrentTableNamespace = string.Empty;
- int nsSeperator = CurrentTableFullName.IndexOf(':');
- if (nsSeperator > -1)
+ int nsSeparator = CurrentTableFullName.IndexOf(':');
+ if (nsSeparator > -1)
{
- CurrentTableNamespace = CurrentTableFullName.Substring(0, nsSeperator);
+ CurrentTableNamespace = CurrentTableFullName.Substring(0, nsSeparator);
}
- string CurrentTableName = CurrentTableFullName.Substring(nsSeperator + 1);
+ string CurrentTableName = CurrentTableFullName.Substring(nsSeparator + 1);
currentTable = ds.Tables[CurrentTableName, CurrentTableNamespace];
}
// D5. Test remainder. Carry indicates result<0, therefore QH 1 too large
if (HI(dwlAccum) == 0)
{
- // D6. Add back - probabilty is 2**(-31). R += D. Q[digit] -= 1
+ // D6. Add back - probability is 2**(-31). R += D. Q[digit] -= 1
uint ulCarry;
rgulQ[iulRindex - ciulD] = QH - 1;
DataRow[] drSelect;
List<DataRow> al;
- //add some rows
+ // add some rows
dt.Rows.Add(new object[] { 99, 88, "bla", "wowww" });
dt.Rows.Add(new object[] { 999, 888, string.Empty, "woowww" });
- //get excepted resault
+ // get excepted result
al = new List<DataRow>();
foreach (DataRow dr in dt.Rows)
{
drSelect = dt.Select("ChildId=1", "ParentId Desc");
Assert.Equal(al.ToArray(), drSelect);
- //get excepted resault
+ // get excepted result
al = new List<DataRow>();
foreach (DataRow dr in dt.Rows)
{
drSelect = dt.Select("String1='1-String1'", "ParentId Desc");
Assert.Equal(al.ToArray(), drSelect);
- //get excepted resault
+ // get excepted result
al = new List<DataRow>();
foreach (DataRow dr in dt.Rows)
{
Assert.Equal(al.ToArray(), drSelect);
- //get excepted resault
+ // get excepted result
al = new List<DataRow>();
foreach (DataRow dr in dt.Rows)
{
//Random
//Means that the user can ask for the values int any order (ie: out of order).
// In order to achieve this on a forward only stream, we need to actually
- // retreive all the value in between so they can go back to values they've skipped
+ // retrieve all the value in between so they can go back to values they've skipped
for (int c = 0; c < i; c++)
{
if (values[c] == null)
case ODBC32.SQLRETURN.SUCCESS_WITH_INFO:
{
//Optimize to only create the event objects and obtain error info if
- //the user is really interested in retriveing the events...
+ //the user is really interested in retrieveing the events...
if (_infoMessageEventHandler != null)
{
OdbcErrorCollection errors = ODBC32.GetDiagErrors(null, hrHandle, retcode);
public delegate ActivitySamplingResult SampleActivity<T>(ref ActivityCreationOptions<T> options);
/// <summary>
- /// ActivityListener allows listening to the start and stop Activity events and give the oppertunity to decide creating the Activity for sampling scenarios.
+ /// ActivityListener allows listening to the start and stop Activity events and give the opportunity to decide creating the Activity for sampling scenarios.
/// </summary>
public sealed class ActivityListener : IDisposable
{
if (0 <= dotIdx)
idIdx = dotIdx + 1;
- string propertName = transformSpec.Substring(idIdx, endIdx - idIdx);
- _fetches = new PropertySpec(propertName, _fetches);
+ string propertyName = transformSpec.Substring(idIdx, endIdx - idIdx);
+ _fetches = new PropertySpec(propertyName, _fetches);
// If the user did not explicitly set a name, it is the last one (first to be processed from the end).
if (_outputName == null)
- _outputName = propertName;
+ _outputName = propertyName;
endIdx = dotIdx; // This works even when LastIndexOf return -1.
}
return false;
}
- private static readonly char[] s_instrumentSeperators = new char[] { '\r', '\n', ',', ';' };
+ private static readonly char[] s_instrumentSeparators = new char[] { '\r', '\n', ',', ';' };
[UnsupportedOSPlatform("browser")]
private void ParseSpecs(string? metricsSpecs)
{
return;
}
- string[] specStrings = metricsSpecs.Split(s_instrumentSeperators, StringSplitOptions.RemoveEmptyEntries);
+ string[] specStrings = metricsSpecs.Split(s_instrumentSeparators, StringSplitOptions.RemoveEmptyEntries);
foreach (string specString in specStrings)
{
if (!MetricSpec.TryParse(specString, out MetricSpec spec))
activity.Stop();
/****************************************************/
- // Confirm that that flags are propagated to children.
+ // Confirm that the flags are propagated to children.
activity = new Activity("activity4");
activity.SetParentId("00-0123456789abcdef0123456789abcdef-0123456789abcdef-01");
activity.Start();
}
[StructLayout(LayoutKind.Explicit, CharSet = CharSet.Auto)]
-#pragma warning disable 618 // Ssytem.Core still uses SecurityRuleSet.Level1
+#pragma warning disable 618 // System.Core still uses SecurityRuleSet.Level1
[SecurityCritical(SecurityCriticalScope.Everything)]
#pragma warning restore 618
internal struct EvtVariant
Notice the `Critical` keyword in the command line, that is used to filter out the other events with lower priorities.
-In the next relaese of PerfView (> 2.0.26), we can visualize the counters using PerfView. To do so, you can right click on the event like this and choose the show event counter graph item:
+In the next release of PerfView (> 2.0.26), we can visualize the counters using PerfView. To do so, you can right click on the event like this and choose the show event counter graph item:
<img src="PerfViewCapture_Menu.png" alt="Show EventCounter graph menu item" title="Show EventCounter graph menu item" />
List<byte[]> sidList = new List<byte[]>(_foreignMembersCurrentGroup.Count);
- // Foreach foreign principal retrive the sid.
+ // Foreach foreign principal retrieve the sid.
// If the SID is for a fake object we have to track it separately. If we were attempt to translate it
// it would fail and not be returned and we would lose it.
// Once we have a list of sids then translate them against the target store in one call.
// SID search
//
//
- // If we can read the defaultNamingContext and retrive the well known path for the foreignSecurityPrincipal container start there.
+ // If we can read the defaultNamingContext and retrieve the well known path for the foreignSecurityPrincipal container start there.
// If we can only read the defaultNamingContext then start there
// Else just start at the base DN from the original context
//
GlobalDebug.WriteLineIf(GlobalDebug.Info, "ADStoreCtx", "GetGroupsMemberOf(ctx): Read DNC of {0}", this.DefaultNamingContext);
- fspWkDn = ADUtils.RetriveWkDn(dncContainer, this.DefaultNamingContext, this.UserSuppliedServerName, Constants.GUID_FOREIGNSECURITYPRINCIPALS_CONTAINER_BYTE);
+ fspWkDn = ADUtils.RetrieveWkDn(dncContainer, this.DefaultNamingContext, this.UserSuppliedServerName, Constants.GUID_FOREIGNSECURITYPRINCIPALS_CONTAINER_BYTE);
if (null != fspWkDn)
{
}
else
{
- // We don't need to retrive the Primary group ID here because we have already established that this user is not from this domain
+ // We don't need to retrieve the Primary group ID here because we have already established that this user is not from this domain
// and the users primary group must be from the same domain as the user.
Debug.Assert(foreignPrincipal.ContextType != ContextType.ApplicationDirectory);
{
}
- // Since we were able to retrive the computer domain above we should be able to access the current forest here.
+ // Since we were able to retrieve the computer domain above we should be able to access the current forest here.
Forest currentForest = Forest.GetCurrentForest();
Domain targetdom = Domain.GetDomain(new DirectoryContext(DirectoryContextType.Domain, targetDomain, username, password));
return false;
}
- internal static string RetriveWkDn(DirectoryEntry deBase, string defaultNamingContext, string serverName, byte[] wellKnownContainerGuid)
+ internal static string RetrieveWkDn(DirectoryEntry deBase, string defaultNamingContext, string serverName, byte[] wellKnownContainerGuid)
{
/*
bool w2k3Supported = false;
throw new InvalidOperationException(SR.InvalidPropertyForStore);
// If we get to this point we know that the value of the property has changed and we should not load it from the store.
- // If value is retrived the state is set to loaded. Even if user modifies the reference we will
+ // If value is retrieved the state is set to loaded. Even if user modifies the reference we will
// not overwrite it because we mark it as loaded.
// If the user sets it before reading it we mark it as changed. When the users accesses it we just return the current
// value. All change tracking to the store is done off of an actual object comparison because users can change the value
return false;
}
- // Retrive the parsed username which has had the domain removed because LogonUser
+ // Retrieve the parsed username which has had the domain removed because LogonUser
// expects creds this way.
string userName = credential.ParsedUserName;
string password = credential.Password;
var connection = new LdapConnection("server");
connection.AuthType = AuthType.Anonymous;
// When calling Bind we make sure that the exception thrown is not that there was a NullReferenceException
- // trying to retrive a null password's lenght, but instead an LdapException given the server cannot be reached.
+ // trying to retrieve a null password's lenght, but instead an LdapException given the server cannot be reached.
Assert.Throws<LdapException>(() => connection.Bind());
}
//
// this api obtains the list of DCs/GCs based on dns records. The DCs/GCs that have registered
- // non site specific records for the domain/forest are returned. Additonally DCs/GCs that have registered site specific records
+ // non site specific records for the domain/forest are returned. Additionally DCs/GCs that have registered site specific records
// (site is either specified or defaulted to the site of the local machine) are also returned in this list.
//
_options = new DirectoryEntryConfiguration(this);
// We are starting from an already bound connection so make sure the options are set properly.
- // If this is an externallly managed com object then we don't want to change it's current behavior
+ // If this is an externally managed com object then we don't want to change it's current behavior
if (!AdsObjIsExternal)
{
InitADsObjectOptions();
T item = GetExistingItem();
// These linq calls make an IEnumerable of pairs of functions that are not identical
- // (eg. not (creationtime, creationtime)), includes both orders as seperate entries
+ // (eg. not (creationtime, creationtime)), includes both orders as separate entries
// as they it have different behavior in reverse order (of functions), in addition
// to the pairs of functions, there is a reverse bool that allows a test for both
// increasing and decreasing timestamps as to not limit the test unnecessarily.
while (path.Length < characterCount)
{
- // Add directory seperator after each dir but not at the end of the path
+ // Add directory separator after each dir but not at the end of the path
path.Append(Path.DirectorySeparatorChar);
// Continue adding unique path segments until the character count is hit
{
_properties.Clear();
- // For each key in the defaultProperties Hashtable set poperties[key]
+ // For each key in the defaultProperties Hashtable set properties[key]
// with the corresponding value in defaultProperties
foreach (object key in defaultProperties.Keys)
{
VisitExpressions(open, expressions, close, ", ");
}
- private void VisitExpressions<T>(char open, ReadOnlyCollection<T> expressions, char close, string seperator) where T : Expression
+ private void VisitExpressions<T>(char open, ReadOnlyCollection<T> expressions, char close, string separator) where T : Expression
{
Out(open);
if (expressions != null)
}
else
{
- Out(seperator);
+ Out(separator);
}
Visit(e);
}
}
[Fact]
- public static void VisitChangingOnlyParmeters()
+ public static void VisitChangingOnlyParameters()
{
BlockExpression block = Expression.Block(
new[] { Expression.Parameter(typeof(int)), Expression.Parameter(typeof(string)) },
}
[Fact]
- public static void VisitChangingOnlyParmetersMultiStatementBody()
+ public static void VisitChangingOnlyParametersMultiStatementBody()
{
BlockExpression block = Expression.Block(
new[] { Expression.Parameter(typeof(int)), Expression.Parameter(typeof(string)) },
}
[Fact]
- public static void VisitChangingOnlyParmetersTyped()
+ public static void VisitChangingOnlyParametersTyped()
{
BlockExpression block = Expression.Block(
typeof(object),
AssertExtensions.Throws<ArgumentException>("switchValue", () => Expression.Switch(typeof(int), Expression.Empty(), Expression.Constant(1), default(MethodInfo), Enumerable.Empty<SwitchCase>()));
}
- public static IEnumerable<object[]> ComparisonsWithInvalidParmeterCounts()
+ public static IEnumerable<object[]> ComparisonsWithInvalidParameterCounts()
{
Func<bool> nullary = () => true;
yield return new object[] { nullary.GetMethodInfo() };
yield return new object[] { quaternary.GetMethodInfo() };
}
- [Theory, MemberData(nameof(ComparisonsWithInvalidParmeterCounts))]
+ [Theory, MemberData(nameof(ComparisonsWithInvalidParameterCounts))]
public void InvalidComparisonMethodParameterCount(MethodInfo comparison)
{
AssertExtensions.Throws<ArgumentException>("comparison", () => Expression.Switch(Expression.Constant(0), Expression.Empty(), comparison));
/// <summary>
/// Function for generating the helper class "ManagementSystemProperties" which is
- /// used for seperating the system properties from the other properties. This is used
+ /// used for separating the system properties from the other properties. This is used
/// just to make the drop down list in the editor to look good.
/// </summary>
private CodeTypeDeclaration GenerateSystemPropertiesClass()
}
/// <summary>
- /// Function to convert a given ValueMap or BitMap name to propert enum name
+ /// Function to convert a given ValueMap or BitMap name to property enum name
/// </summary>
private static string ConvertValuesToName(string str)
{
<Compile Include="BaseCertificateTest.cs" />
<Compile Include="ServerCertificateTest.cs" />
<Compile Include="WinHttpHandlerTest.cs" />
- <Compile Include="XunitTestAssemblyAtrributes.cs" />
+ <Compile Include="XunitTestAssemblyAttributes.cs" />
<Compile Include="$(CommonPath)\System\Net\Http\HttpHandlerDefaults.cs"
Link="Common\System\Net\Http\HttpHandlerDefaults.cs" />
<Compile Include="$(CommonTestPath)System\IO\DelegateStream.cs"
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-
-using Xunit;
-
-// The WinHttpHandler unit tests need to have parallelism turned off between test classes since they rely on
-// a mock network with simulated failures controlled by singleton static classes (TestControl, TestServer).
-// This attribute will put all test classes into a single collection. Default Xunit behavior is to run tests
-// within a single collection in series and not in parallel.
-[assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly)]
--- /dev/null
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System;
+
+using Xunit;
+
+// The WinHttpHandler unit tests need to have parallelism turned off between test classes since they rely on
+// a mock network with simulated failures controlled by singleton static classes (TestControl, TestServer).
+// This attribute will put all test classes into a single collection. Default Xunit behavior is to run tests
+// within a single collection in series and not in parallel.
+[assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly)]
<Compile Include="WinHttpRequestStreamTest.cs" />
<Compile Include="WinHttpResponseHeaderReaderTest.cs" />
<Compile Include="WinHttpResponseStreamTest.cs" />
- <Compile Include="XunitTestAssemblyAtrributes.cs" />
+ <Compile Include="XunitTestAssemblyAttributes.cs" />
</ItemGroup>
</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-
-using Xunit;
-
-// The WinHttpHandler unit tests need to have parallelism turned off between test classes since they rely on
-// a mock network with simulated failures controlled by singleton static classes (TestControl, TestServer).
-// This attribute will put all test classes into a single collection. Default Xunit behavior is to run tests
-// within a single collection in series and not in parallel.
-[assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly)]
--- /dev/null
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System;
+
+using Xunit;
+
+// The WinHttpHandler unit tests need to have parallelism turned off between test classes since they rely on
+// a mock network with simulated failures controlled by singleton static classes (TestControl, TestServer).
+// This attribute will put all test classes into a single collection. Default Xunit behavior is to run tests
+// within a single collection in series and not in parallel.
+[assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly)]
internal enum CloseExState
{
Normal = 0x0, // just a close
- Abort = 0x1, // unconditionaly release resources
+ Abort = 0x1, // unconditionally release resources
Silent = 0x2 // do not throw on close if possible
}
}
}
- // MacOS has has special validation rules for apple.com and icloud.com
+ // MacOS has special validation rules for apple.com and icloud.com
[ConditionalTheory]
[OuterLoop("Uses external servers")]
[InlineData("www.apple.com")]
}
[Fact]
- public async Task TcpClientSocket_WhenBoundToWildcardAddress_LocalEPChangeToSpecificOnConnnect()
+ public async Task TcpClientSocket_WhenBoundToWildcardAddress_LocalEPChangeToSpecificOnConnect()
{
using (Socket server = CreateTcpSocket())
using (Socket client = CreateTcpSocket())
}
[Fact]
- public async Task TcpClientSocket_WhenNotBound_LocalEPChangeToSpecificOnConnnect()
+ public async Task TcpClientSocket_WhenNotBound_LocalEPChangeToSpecificOnConnect()
{
using (Socket server = CreateTcpSocket())
using (Socket client = CreateTcpSocket())
{
if (t != null)
{
- hashCode ^= t.GetHashCode(); // same hashcode as as default comparer
+ hashCode ^= t.GetHashCode(); // same hashcode as default comparer
}
}
}
return path;
}
- // Seperate type so a .cctor is not created for Enviroment which then would be triggered during startup
+ // Separate type so a .cctor is not created for Environment which then would be triggered during startup
private static class WindowsVersion
{
// Cache the value in static readonly that can be optimized out by the JIT
{
tokenType = tempType;
tokenValue = tempValue;
- // This is a token, so the Index has been advanced propertly in DTFI.Tokenizer().
+ // This is a token, so the Index has been advanced properly in DTFI.Tokenizer().
}
else
{
else if (!IsWordSeparator(charType))
{
// This category is considered to be part of the word.
- // This is any category that is marked as false in wordSeprator array.
+ // This is any category that is marked as false in wordSeparator array.
i += charLen;
}
else
// Used in ToTitleCase():
// When we find a starting letter, the following array decides if a category should be
- // considered as word seprator or not.
+ // considered as word separator or not.
private const int c_wordSeparatorMask =
/* false */ (0 << 0) | // UppercaseLetter = 0,
/* false */ (0 << 1) | // LowercaseLetter = 1,
{
// This was probably meant to call _unmanagedStream.SetLength(value), but it was forgotten in V.4.0.
// Now this results in a call to the base which touches the underlying array which is never actually used.
- // We cannot fix it due to compat now, but we should fix this at the next SxS release oportunity.
+ // We cannot fix it due to compat now, but we should fix this at the next SxS release opportunity.
base.SetLength(value);
}
NestedFamANDAssem = 0x00000006, // Class is nested with family and assembly visibility.
NestedFamORAssem = 0x00000007, // Class is nested with family or assembly visibility.
- // Use this mask to retrieve class layout informaiton
+ // Use this mask to retrieve class layout information
// 0 is AutoLayout, 0x2 is SequentialLayout, 4 is ExplicitLayout
LayoutMask = 0x00000018,
AutoLayout = 0x00000000, // Class fields are auto-laid out
/// If unable to get the <typeparamref name="TManager"/> type, returns false.
/// </summary>
/// <typeparam name="T">The element type of the <paramref name="memory" />.</typeparam>
- /// <typeparam name="TManager">The type of <see cref="MemoryManager{T}"/> to try and retrive.</typeparam>
+ /// <typeparam name="TManager">The type of <see cref="MemoryManager{T}"/> to try and retrieve.</typeparam>
/// <param name="memory">The memory to get the manager for.</param>
/// <param name="manager">The returned manager of the <see cref="ReadOnlyMemory{T}"/>.</param>
/// <returns>A <see cref="bool"/> indicating if it was successful.</returns>
/// If unable to get the <typeparamref name="TManager"/> type, returns false.
/// </summary>
/// <typeparam name="T">The element type of the <paramref name="memory" />.</typeparam>
- /// <typeparam name="TManager">The type of <see cref="MemoryManager{T}"/> to try and retrive.</typeparam>
+ /// <typeparam name="TManager">The type of <see cref="MemoryManager{T}"/> to try and retrieve.</typeparam>
/// <param name="memory">The memory to get the manager for.</param>
/// <param name="manager">The returned manager of the <see cref="ReadOnlyMemory{T}"/>.</param>
/// <param name="start">The offset from the start of the <paramref name="manager" /> that the <paramref name="memory" /> represents.</param>
if (processorCount > 1 && (spinIndex < sleep0Threshold || (spinIndex - sleep0Threshold) % 2 != 0))
{
// Cap the maximum spin count to a value such that many thousands of CPU cycles would not be wasted doing
- // the equivalent of YieldProcessor(), as that that point SwitchToThread/Sleep(0) are more likely to be able to
+ // the equivalent of YieldProcessor(), as at that point SwitchToThread/Sleep(0) are more likely to be able to
// allow other useful work to run. Long YieldProcessor() loops can help to reduce contention, but Sleep(1) is
// usually better for that.
int n = Thread.OptimalMaxSpinWaitsPerSpinIteration;
throw new InvalidOperationException(SR.net_uri_NotAbsolute);
}
- // Note: Compatibilty with V1 that does not report user info
+ // Note: Compatibility with V1 that does not report user info
return GetParts(UriComponents.Host | UriComponents.Port, UriFormat.UriEscaped);
}
}
}
[Fact]
- public void UriMailTo_TwoSemiColonSepratedAddresses_Success()
+ public void UriMailTo_TwoSemiColonSeparatedAddresses_Success()
{
Assert.ThrowsAny<FormatException>(() => new Uri("mailto:User@Host;User@Host"));
}
[Fact]
- public void UriMailTo_TwoCommaSepratedAddresses_Success()
+ public void UriMailTo_TwoCommaSeparatedAddresses_Success()
{
Assert.ThrowsAny<FormatException>(() => new Uri("mailto:User@Host,User@Host"));
}
public static XmlSchemaSet schemaSet;
public static string xmlString;
public static XDocument xmlDocument;
- public static bool validationSucceded;
+ public static bool validationSucceeded;
// initialize values for tests
public SchemaExtensionsTests()
<body>Don't forget to call me!</body>
</note>";
xmlDocument = XDocument.Load(new StringReader(xmlString));
- validationSucceded = false;
+ validationSucceeded = false;
/*
* Use this method to load the above data from disk
// this gets called when a validation error occurs
private void TestValidationHandler(object sender, ValidationEventArgs e)
{
- validationSucceded = false;
+ validationSucceeded = false;
}
// test succesful validation
[Fact]
public void XDocumentSuccessValidate()
{
- validationSucceded = true;
+ validationSucceeded = true;
ExtensionsClass.Validate(xmlDocument, schemaSet,
new ValidationEventHandler(TestValidationHandler));
- Assert.True(validationSucceded);
+ Assert.True(validationSucceeded);
}
// test failed validation
var newElement = new XElement(elementName, elementValue);
xmlDocument.Root.Add(newElement);
- validationSucceded = true;
+ validationSucceeded = true;
ExtensionsClass.Validate(xmlDocument, schemaSet,
new ValidationEventHandler(TestValidationHandler));
- Assert.False(validationSucceded);
+ Assert.False(validationSucceeded);
}
/*
}
// populate XML with PSVI
- validationSucceded = true;
+ validationSucceeded = true;
ExtensionsClass.Validate(xmlDocument, schemaSet,
new ValidationEventHandler(TestValidationHandler), true);
- Assert.True(validationSucceded);
+ Assert.True(validationSucceeded);
// no. of elements after validation
elements = xmlDocument.Elements();
}
// don't populate XML with PSVI
- validationSucceded = true;
+ validationSucceeded = true;
ExtensionsClass.Validate(xmlDocument, schemaSet,
new ValidationEventHandler(TestValidationHandler), false);
- Assert.True(validationSucceded);
+ Assert.True(validationSucceeded);
// no. of elements after validation
elements = xmlDocument.Elements();
object attributeValue = "2010-05-27";
// validate the entire document
- validationSucceded = true;
+ validationSucceeded = true;
ExtensionsClass.Validate(xmlDocument, schemaSet,
new ValidationEventHandler(TestValidationHandler), true);
- Assert.True(validationSucceded);
+ Assert.True(validationSucceeded);
// change and re-validate attribute value
XAttribute date = xmlDocument.Element(elementName).Attribute(attributeName);
date.SetValue(attributeValue);
ExtensionsClass.Validate(date, date.GetSchemaInfo().SchemaAttribute,schemaSet,
new ValidationEventHandler(TestValidationHandler));
- Assert.True(validationSucceded);
+ Assert.True(validationSucceeded);
}
// attribute validation fails after change
object attributeValue = "2010-12-32";
// validate the entire document
- validationSucceded = true;
+ validationSucceeded = true;
ExtensionsClass.Validate(xmlDocument, schemaSet,
new ValidationEventHandler(TestValidationHandler),true);
- Assert.True(validationSucceded);
+ Assert.True(validationSucceeded);
// change and re-validate attribute value
XAttribute date = xmlDocument.Element(elementName).Attribute(attributeName);
date.SetValue(attributeValue);
ExtensionsClass.Validate(date, date.GetSchemaInfo().SchemaAttribute, schemaSet,
new ValidationEventHandler(TestValidationHandler));
- Assert.False(validationSucceded);
+ Assert.False(validationSucceeded);
}
/*
object attributeValue = "2010-12-32";
// validate the entire document
- validationSucceded = true;
+ validationSucceeded = true;
ExtensionsClass.Validate(xmlDocument, schemaSet,
new ValidationEventHandler(TestValidationHandler),true);
- Assert.True(validationSucceded);
+ Assert.True(validationSucceeded);
// change and re-validate attribute value
XAttribute date = xmlDocument.Element(elementName).Attribute(attributeName);
object childElementValue = "Please call me!";
// validate the entire document
- validationSucceded = true;
+ validationSucceeded = true;
ExtensionsClass.Validate(xmlDocument, schemaSet,
new ValidationEventHandler(TestValidationHandler), true);
- Assert.True(validationSucceded);
+ Assert.True(validationSucceeded);
// alter element
XElement root = xmlDocument.Element(parentElementName);
ExtensionsClass.Validate(root, root.GetSchemaInfo().SchemaElement, schemaSet,
new ValidationEventHandler(TestValidationHandler));
- Assert.True(validationSucceded);
+ Assert.True(validationSucceeded);
}
// element validation fails after change
object childElementValue = "Don't forget to call me! Please!";
// validate the entire document
- validationSucceded = true;
+ validationSucceeded = true;
ExtensionsClass.Validate(xmlDocument, schemaSet,
new ValidationEventHandler(TestValidationHandler), true);
- Assert.True(validationSucceded);
+ Assert.True(validationSucceeded);
// alter element
XElement root = xmlDocument.Element(parentElementName);
ExtensionsClass.Validate(root, root.GetSchemaInfo().SchemaElement, schemaSet,
new ValidationEventHandler(TestValidationHandler));
- Assert.False(validationSucceded);
+ Assert.False(validationSucceeded);
}
object childElementValue = "Don't forget to call me! Please!";
// validate the entire document
- validationSucceded = true;
+ validationSucceeded = true;
ExtensionsClass.Validate(xmlDocument, schemaSet,
new ValidationEventHandler(TestValidationHandler), true);
- Assert.True(validationSucceded);
+ Assert.True(validationSucceeded);
// alter element
XElement root = xmlDocument.Element(parentElementName);
string attributeName = "date";
// validate the entire document
- validationSucceded = true;
+ validationSucceeded = true;
ExtensionsClass.Validate(xmlDocument, schemaSet,
new ValidationEventHandler(TestValidationHandler), true);
- Assert.True(validationSucceded);
+ Assert.True(validationSucceeded);
// validate attribute
XAttribute date = xmlDocument.Element(elementName).Attribute(attributeName);
ExtensionsClass.Validate(date, date.GetSchemaInfo().SchemaAttribute, schemaSet,
new ValidationEventHandler(TestValidationHandler));
- Assert.True(validationSucceded);
+ Assert.True(validationSucceeded);
IXmlSchemaInfo schemaInfo = ExtensionsClass.GetSchemaInfo(date);
Assert.NotNull(schemaInfo);
string elementName = "body";
// validate the entire document
- validationSucceded = true;
+ validationSucceeded = true;
ExtensionsClass.Validate(xmlDocument, schemaSet,
new ValidationEventHandler(TestValidationHandler), true);
- Assert.True(validationSucceded);
+ Assert.True(validationSucceeded);
// validate element
XElement body = xmlDocument.Root.Element(elementName);
ExtensionsClass.Validate(body, body.GetSchemaInfo().SchemaElement, schemaSet,
new ValidationEventHandler(TestValidationHandler));
- Assert.True(validationSucceded);
+ Assert.True(validationSucceeded);
IXmlSchemaInfo schemaInfo = ExtensionsClass.GetSchemaInfo(body);
Assert.NotNull(schemaInfo);
public class Tokens
{
public string Equal = "=";
- public string Seperator = ";";
+ public string Separator = ";";
public string SingleQuote = "'";
public string DoubleQuote = "\"";
}
break;
case PARSE.Keyword:
- if (tokens.Seperator.IndexOf(ch) >= 0)
+ if (tokens.Separator.IndexOf(ch) >= 0)
{
state = PARSE.Initial;
}
{
state = PARSE.DoubleBegin;
}
- else if (tokens.Seperator.IndexOf(ch) >= 0)
+ else if (tokens.Separator.IndexOf(ch) >= 0)
{
keywords.Update(key, string.Empty);
state = PARSE.Initial;
break;
case PARSE.Value:
- if (tokens.Seperator.IndexOf(ch) >= 0)
+ if (tokens.Separator.IndexOf(ch) >= 0)
{
keywords.Update(key, (builder.ToString()).Trim());
state = PARSE.Initial;
break;
case PARSE.End:
- if (tokens.Seperator.IndexOf(ch) >= 0)
+ if (tokens.Separator.IndexOf(ch) >= 0)
{
state = PARSE.Initial;
}
//CommandLine Options
KeywordParser.Tokens tokens = new KeywordParser.Tokens();
tokens.Equal = " ";
- tokens.Seperator = "/";
+ tokens.Separator = "/";
Dictionary<string, string> options = KeywordParser.ParseKeywords(commandline, tokens);
foreach (string key in options.Keys)
s_pproperties["CommandLine/" + key] = options[key];
//CommandLine Options
KeywordParser.Tokens tokens = new KeywordParser.Tokens();
tokens.Equal = " ";
- tokens.Seperator = "/";
+ tokens.Separator = "/";
Dictionary<string, string> options = KeywordParser.ParseKeywords(commandLine, tokens);
foreach (string key in options.Keys)
TestInput.Properties["CommandLine/" + key] = options[key];
this.AddChild(new TestVariation(writeValue_13) { Attribute = new VariationAttribute("Write multiple atomic values inside element, separate by WriteWhitespace(' ')") { Id = 13, Priority = 1 } });
this.AddChild(new TestVariation(writeValue_14) { Attribute = new VariationAttribute("Write multiple atomic values inside element, separate by WriteString(' ')") { Id = 14, Priority = 1 } });
this.AddChild(new TestVariation(writeValue_15) { Attribute = new VariationAttribute("Write multiple atomic values inside attribute, separate by WriteWhitespace(' ')") { Id = 15, Priority = 1 } });
- this.AddChild(new TestVariation(writeValue_16) { Attribute = new VariationAttribute("Write multiple atomic values inside attribute, seperate by WriteString(' ')") { Id = 16, Priority = 1 } });
+ this.AddChild(new TestVariation(writeValue_16) { Attribute = new VariationAttribute("Write multiple atomic values inside attribute, separate by WriteString(' ')") { Id = 16, Priority = 1 } });
this.AddChild(new TestVariation(writeValue_17) { Attribute = new VariationAttribute("WriteValue(long)") { Id = 17, Priority = 1 } });
}
}
if (originalReader.NodeType == XmlNodeType.Element)
{
// read all r1 attributes
- var origAttrs = MoveAtrributeEnumerator(originalReader).ToArray();
+ var origAttrs = MoveAttributeEnumerator(originalReader).ToArray();
// read all r2 attributes
- var filteredAttrs = MoveAtrributeEnumerator(filteredReader).ToArray();
+ var filteredAttrs = MoveAttributeEnumerator(filteredReader).ToArray();
// Verify HasAttributes consistency
TestLog.Compare(filteredAttrs.Any(), filteredReader.HasAttributes, "has attributes");
}
}
- private static IEnumerable<string[]> IndexedAtrributeEnumerator(XmlReader r, bool moveToElement)
+ private static IEnumerable<string[]> IndexedAttributeEnumerator(XmlReader r, bool moveToElement)
{
TestLog.Compare(r.NodeType, XmlNodeType.Element, "Assert for enumerator"); // assert
int aCount = r.AttributeCount;
r.MoveToElement();
}
- private static IEnumerable<string[]> MoveAtrributeEnumerator(XmlReader r)
+ private static IEnumerable<string[]> MoveAttributeEnumerator(XmlReader r)
{
TestLog.Compare(r.NodeType, XmlNodeType.Element, "Assert for enumerator"); // assert
if (r.MoveToFirstAttribute())
<?xml version="1.0" encoding="utf-8"?>
<root>
- <!--
- Microsoft ResX Schema
-
+ <!--
+ Microsoft ResX Schema
+
Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
associated with the data types.
-
+
Example:
-
+
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
-
- There are any number of "resheader" rows that contain simple
+
+ There are any number of "resheader" rows that contain simple
name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
-
+
mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
+ value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
-
+
mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
+ value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
+ value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<data name="Xml_NoDTDPresent" xml:space="preserve">
<value>No DTD found.</value>
</data>
- <data name="Xml_MultipleValidaitonTypes" xml:space="preserve">
+ <data name="Xml_MultipleValidationTypes" xml:space="preserve">
<value>Unsupported combination of validation types.</value>
</data>
<data name="Xml_NoValidation" xml:space="preserve">
Usage: dotnet {0} [--assembly <assembly file path>] [--type <type name>]</value>
</data>
<data name="HelpDevOptions" xml:space="preserve">
- <value>
+ <value>
Developer options:</value>
</data>
<data name="HelpAssembly" xml:space="preserve">
<value> {0}|{1} Output directory name (default: target assembly location).</value>
</data>
<data name="HelpMiscOptions" xml:space="preserve">
- <value>
+ <value>
Miscellaneous options:</value>
</data>
<data name="HelpHelp" xml:space="preserve">
_ps.charPos += 5;
- // parsing of text declarations cannot change global stringBuidler or curNode as we may be in the middle of a text node
+ // parsing of text declarations cannot change global stringBuilder or curNode as we may be in the middle of a text node
Debug.Assert(_stringBuilder.Length == 0 || isTextDecl);
StringBuilder sb = isTextDecl ? new StringBuilder() : _stringBuilder;
}
_ps.charPos += 5;
- // parsing of text declarations cannot change global stringBuidler or curNode as we may be in the middle of a text node
+ // parsing of text declarations cannot change global stringBuilder or curNode as we may be in the middle of a text node
Debug.Assert(_stringBuilder.Length == 0 || isTextDecl);
StringBuilder sb = isTextDecl ? new StringBuilder() : _stringBuilder;
if (depth == this.curDepth - 1)
{
// really need to move the current node pointer to parent
- // what i did here is for seperating the case of IsDss or only IsChild
- // bcoz in the first case i need to expect "a" from random depth
+ // what i did here is for separating the case of IsDss or only IsChild
+ // because in the first case i need to expect "a" from random depth
// -1 means it doesn't expect some specific depth (referecing the dealing to -1 in movetochild method
// while in the second case i can't change the root depth which is 1.
if ((this.curNode.Input == parent.RootNode) && (parent.IsDss))
if (complexType.Particle != null || complexType.Attributes != null)
{
- // this is illigal
+ // this is illegal
}
if (complexType.ContentModel is XmlSchemaSimpleContent)
{
if (complexType.Particle != null || complexType.Attributes != null)
{
- // this is illigal
+ // this is illegal
}
if (complexType.ContentModel is XmlSchemaSimpleContent)
{
{
CompileAttributeGroup(baseAttributeGroup);
CompileAttributeGroup(attributeGroup);
- CheckAtrributeGroupRestriction(baseAttributeGroup, attributeGroup);
+ CheckAttributeGroupRestriction(baseAttributeGroup, attributeGroup);
}
}
}
}
- private void CheckAtrributeGroupRestriction(XmlSchemaAttributeGroup baseAttributeGroup, XmlSchemaAttributeGroup derivedAttributeGroup)
+ private void CheckAttributeGroupRestriction(XmlSchemaAttributeGroup baseAttributeGroup, XmlSchemaAttributeGroup derivedAttributeGroup)
{
XmlSchemaAnyAttribute? baseAnyAtt = baseAttributeGroup.AttributeWildcard;
XmlSchemaAnyAttribute? derivedAnyAtt = derivedAttributeGroup.AttributeWildcard;
{
if (schemaInfo.SchemaType != SchemaType.XDR)
{
- throw new XmlException(SR.Xml_MultipleValidaitonTypes, string.Empty, this.PositionInfo.LineNumber, this.PositionInfo.LinePosition);
+ throw new XmlException(SR.Xml_MultipleValidationTypes, string.Empty, this.PositionInfo.LineNumber, this.PositionInfo.LinePosition);
}
this.schemaInfo.Add(schemaInfo, EventHandler);
} // foreach constraint /constraintstruct
// added on June 19, make connections between new keyref tables with key/unique tables in stack
- // i can't put it in the above loop, coz there will be key on the same level
+ // i can't put it in the above loop, because there will be key on the same level
for (int i = 0; i < _context.Constr.Length; ++i)
{
if (_context.Constr[i].constraint.Role == CompiledIdentityConstraint.ConstraintRole.Keyref)
{
if (schemaInfo.SchemaType != SchemaType.XSD)
{
- throw new XmlException(SR.Xml_MultipleValidaitonTypes, string.Empty, this.PositionInfo.LineNumber, this.PositionInfo.LinePosition);
+ throw new XmlException(SR.Xml_MultipleValidationTypes, string.Empty, this.PositionInfo.LineNumber, this.PositionInfo.LinePosition);
}
SchemaInfo.Add(schemaInfo, EventHandler);
return;
} // foreach constraint /constraintstruct
// added on June 19, make connections between new keyref tables with key/unique tables in stack
- // i can't put it in the above loop, coz there will be key on the same level
+ // i can't put it in the above loop, because there will be key on the same level
for (int i = 0; i < context.Constr.Length; ++i)
{
if (context.Constr[i].constraint.Role == CompiledIdentityConstraint.ConstraintRole.Keyref)
// 3. In context of global variable
// We treating this methods differentely when they are called to create implicit arguments.
// Implicite argument (position, last) are rare and lead to uneficiant code. So we treating them
- // specialy to be able eliminate them later, wen we compiled everithing and can detect was they used or not.
+ // specially to be able eliminate them later, wen we compiled everithing and can detect was they used or not.
// Returns context node
private QilNode GetCurrentNode()
// Fills invokeArgs with values from actualArgs in order given by formalArgs
// Returns true if formalArgs maps 1:1 with actual args.
- // Formaly this is n*n algorithm. We can optimize it by calculationg "signature"
+ // Formally this is n*n algorithm. We can optimize it by calculationg "signature"
// of the function as sum of all hashes of its args names.
private static bool FillupInvokeArgs(IList<QilNode> formalArgs, IList<XslNode> actualArgs, QilList invokeArgs)
{
_variables[variable.Name!] = variable;
}
- internal int GetVeriablesCount()
+ internal int GetVariablesCount()
{
if (_variables == null)
{
private bool _firstLine = true;
private bool _secondRoot;
- // Cached Output propertes:
+ // Cached Output properties:
private XsltOutput _output;
private bool _isHtmlOutput;
private bool _isXmlOutput;
[Theory]
[ActiveIssue("https://github.com/dotnet/runtime/issues/2383", TestRuntimes.Mono)]
[MemberData(nameof(NotSupportedPrimitives_TestData))]
- [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Coreclr fixed an issue where IntPtr/UIntPtr in propertValues causes a corrupt created binary.")]
+ [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Coreclr fixed an issue where IntPtr/UIntPtr in propertyValues causes a corrupt created binary.")]
public static void NotSupportedPrimitiveInPropertyValues_ThrowsArgumentException(object value)
{
ConstructorInfo con = typeof(TestAttribute).GetConstructor(new Type[0]);
[Theory]
[InlineData(AssemblyBuilderAccess.Run)]
[InlineData(AssemblyBuilderAccess.RunAndCollect)]
- public void SetCustomAttribute_ConstructorBuidler_ByteArray(AssemblyBuilderAccess access)
+ public void SetCustomAttribute_ConstructorBuilder_ByteArray(AssemblyBuilderAccess access)
{
AssemblyBuilder assembly = Helpers.DynamicAssembly(access: access);
ConstructorInfo constructor = typeof(BoolAllAttribute).GetConstructor(new Type[] { typeof(bool) });
}
[Fact]
- public void SetCustomAttribute_ConstructorBuidler_ByteArray_NullConstructorBuilder_ThrowsArgumentNullException()
+ public void SetCustomAttribute_ConstructorBuildler_ByteArray_NullConstructorBuilder_ThrowsArgumentNullException()
{
AssemblyBuilder assembly = Helpers.DynamicAssembly();
AssertExtensions.Throws<ArgumentNullException>("con", () => assembly.SetCustomAttribute(null, new byte[0]));
}
[Fact]
- public void SetCustomAttribute_ConstructorBuidler_ByteArray_NullByteArray_ThrowsArgumentNullException()
+ public void SetCustomAttribute_ConstructorBuildler_ByteArray_NullByteArray_ThrowsArgumentNullException()
{
AssemblyBuilder assembly = Helpers.DynamicAssembly();
ConstructorInfo constructor = typeof(IntAllAttribute).GetConstructor(new Type[] { typeof(int) });
Assert.Throws<MethodAccessException>(() => d ());
}
-
+
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
void Invoke_Private_SameAssembly_ThrowsMethodAccessException()
{
ModuleBuilder modb = Helpers.DynamicModule();
-
+
string calleeName = "PrivateMethod";
TypeBuilder tbCalled = modb.DefineType ("CalledClass", TypeAttributes.Public);
using (var rsa = RSA.Create())
{
- rsa.ImportParameters(RSAParamatersFromBlob(privateKey));
+ rsa.ImportParameters(RSAParametersFromBlob(privateKey));
var signature = rsa.SignHash(hash, HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1);
Array.Reverse(signature);
return signature;
}
}
- private static RSAParameters RSAParamatersFromBlob(byte[] blob)
+ private static RSAParameters RSAParametersFromBlob(byte[] blob)
{
RSAParameters key;
public MethodSig<RoParameter> SpecializeMethodSig(IRoMethodBase roMethodBase)
{
MetadataReader reader = Reader;
- MethodDefinition methodDefiniton = MethodDefinition;
- MethodSignature<RoType> sig = methodDefiniton.DecodeSignature(_module, roMethodBase.TypeContext);
+ MethodDefinition methodDefinition = MethodDefinition;
+ MethodSignature<RoType> sig = methodDefinition.DecodeSignature(_module, roMethodBase.TypeContext);
int numParameters = sig.RequiredParameterCount;
MethodSig<RoParameter> methodSig = new MethodSig<RoParameter>(numParameters);
- foreach (ParameterHandle ph in methodDefiniton.GetParameters())
+ foreach (ParameterHandle ph in methodDefinition.GetParameters())
{
Parameter p = ph.GetParameter(reader);
int position = p.SequenceNumber - 1;
return ret;
}
- private static string GenerateGroups(int[] sizes, string seperator, Random random)
+ private static string GenerateGroups(int[] sizes, string separator, Random random)
{
List<int> total_sizes = new List<int>();
int total;
num_digits -= group_size;
if (num_digits > 0)
{
- digits += seperator;
+ digits += separator;
}
}
return digits;
}
- private static string GroupFormatDigits(string input, string seperator, int[] sizes, string point, int places)
+ private static string GroupFormatDigits(string input, string separator, int[] sizes, string point, int places)
{
string output = string.Empty;
int currentspot = input.Length - 1;
}
else
{
- output = seperator + ZeroString(size) + output;
+ output = separator + ZeroString(size) + output;
currentspot -= size;
}
if (currentsize < sizes.Length - 1)
}
else
{
- output = seperator + input.Substring(currentspot - size + 1, size) + output;
+ output = separator + input.Substring(currentspot - size + 1, size) + output;
currentspot -= size;
}
if (currentsize < sizes.Length - 1)
for (int i = 0; i < s_samples; i++)
{
int[] sizes = null;
- string seperator = null;
+ string separator = null;
string digits = null;
sizes = CultureInfo.CurrentCulture.NumberFormat.NumberGroupSizes;
- seperator = CultureInfo.CurrentCulture.NumberFormat.NumberGroupSeparator;
- digits = GenerateGroups(sizes, seperator, random);
+ separator = CultureInfo.CurrentCulture.NumberFormat.NumberGroupSeparator;
+ digits = GenerateGroups(sizes, separator, random);
if (NoGrouping(sizes))
{
VerifyParseToString(digits);
for (int i = 0; i < s_samples; i++)
{
int[] sizes = null;
- string seperator = null;
+ string separator = null;
string digits = null;
sizes = CultureInfo.CurrentCulture.NumberFormat.NumberGroupSizes;
- seperator = CultureInfo.CurrentCulture.NumberFormat.NumberGroupSeparator;
- digits = GenerateGroups(sizes, seperator, random);
+ separator = CultureInfo.CurrentCulture.NumberFormat.NumberGroupSeparator;
+ digits = GenerateGroups(sizes, separator, random);
VerifyParseToString(digits, ns, NoGrouping(sizes) || ((ns & NumberStyles.AllowThousands) != 0));
}
return y2;
}
- private static string GenerateGroups(int[] sizes, string seperator, Random random)
+ private static string GenerateGroups(int[] sizes, string separator, Random random)
{
List<int> total_sizes = new List<int>();
int total;
num_digits -= group_size;
if (num_digits > 0)
{
- digits += seperator;
+ digits += separator;
}
}
return Globals.DefaultNamespace + clrNs.Replace('.', '/');
}
- static string GetGlobalContractNamespace(string clrNs, ICustomAttributeProvider customAttribuetProvider)
+ static string GetGlobalContractNamespace(string clrNs, ICustomAttributeProvider customAttributeProvider)
{
- object[] nsAttributes = customAttribuetProvider.GetCustomAttributes(typeof(ContractNamespaceAttribute), false);
+ object[] nsAttributes = customAttributeProvider.GetCustomAttributes(typeof(ContractNamespaceAttribute), false);
string dataContractNs = null;
for (int i = 0; i < nsAttributes.Length; i++)
{
}
/// <summary>
- /// Use the secret agreement as the HMAC key rather than supplying a seperate one
+ /// Use the secret agreement as the HMAC key rather than supplying a separate one
/// </summary>
public bool UseSecretAgreementAsHmacKey
{
internal void CreateChildrenElements(IElementFactory elementFactory, IRule parent, IdentifierCollection ruleIds)
{
- foreach (GrammarBuilderBase buider in Items)
+ foreach (GrammarBuilderBase builder in Items)
{
- IElement element = buider.CreateElement(elementFactory, parent, parent, ruleIds);
+ IElement element = builder.CreateElement(elementFactory, parent, parent, ruleIds);
if (element != null)
{
element.PostParse(parent);
internal void CreateChildrenElements(IElementFactory elementFactory, IItem parent, IRule rule, IdentifierCollection ruleIds)
{
- foreach (GrammarBuilderBase buider in Items)
+ foreach (GrammarBuilderBase builder in Items)
{
- IElement element = buider.CreateElement(elementFactory, parent, rule, ruleIds);
+ IElement element = builder.CreateElement(elementFactory, parent, rule, ruleIds);
if (element != null)
{
element.PostParse(parent);
public const byte LineFeed = (byte)'\n';
public const byte Tab = (byte)'\t';
public const byte ListSeparator = (byte)',';
- public const byte KeyValueSeperator = (byte)':';
+ public const byte KeyValueSeparator = (byte)':';
public const byte Quote = (byte)'"';
public const byte BackSlash = (byte)'\\';
public const byte Slash = (byte)'/';
propertySection[0] = JsonConstants.Quote;
utf8Value.CopyTo(propertySection.AsSpan(1, length));
propertySection[++length] = JsonConstants.Quote;
- propertySection[++length] = JsonConstants.KeyValueSeperator;
+ propertySection[++length] = JsonConstants.KeyValueSeparator;
return propertySection;
}
first = _buffer[_consumed];
}
- // The next character must be a key / value seperator. Validate and skip.
- if (first != JsonConstants.KeyValueSeperator)
+ // The next character must be a key / value separator. Validate and skip.
+ if (first != JsonConstants.KeyValueSeparator)
{
ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedSeparatorAfterPropertyNameNotFound, first);
}
first = _buffer[_consumed];
}
- // The next character must be a key / value seperator. Validate and skip.
- if (first != JsonConstants.KeyValueSeperator)
+ // The next character must be a key / value separator. Validate and skip.
+ if (first != JsonConstants.KeyValueSeparator)
{
ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedSeparatorAfterPropertyNameNotFound, first);
}
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Quote;
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Quote;
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
output[BytesPending++] = JsonConstants.Quote;
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
output[BytesPending++] = JsonConstants.Quote;
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Quote;
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Quote;
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
output[BytesPending++] = JsonConstants.Quote;
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
output[BytesPending++] = JsonConstants.Quote;
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Quote;
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Quote;
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
output[BytesPending++] = JsonConstants.Quote;
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
output[BytesPending++] = JsonConstants.Quote;
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
bool result = Utf8Formatter.TryFormat(value, output.Slice(BytesPending), out int bytesWritten);
Debug.Assert(result);
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
bool result = Utf8Formatter.TryFormat(value, output.Slice(BytesPending), out int bytesWritten);
Debug.Assert(result);
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
bool result = Utf8Formatter.TryFormat(value, output.Slice(BytesPending), out int bytesWritten);
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
bool result = Utf8Formatter.TryFormat(value, output.Slice(BytesPending), out int bytesWritten);
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
bool result = TryFormatDouble(value, output.Slice(BytesPending), out int bytesWritten);
Debug.Assert(result);
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
bool result = TryFormatDouble(value, output.Slice(BytesPending), out int bytesWritten);
Debug.Assert(result);
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
bool result = TryFormatDouble(value, output.Slice(BytesPending), out int bytesWritten);
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
bool result = TryFormatDouble(value, output.Slice(BytesPending), out int bytesWritten);
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
bool result = TryFormatSingle(value, output.Slice(BytesPending), out int bytesWritten);
Debug.Assert(result);
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
bool result = TryFormatSingle(value, output.Slice(BytesPending), out int bytesWritten);
Debug.Assert(result);
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
bool result = TryFormatSingle(value, output.Slice(BytesPending), out int bytesWritten);
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
bool result = TryFormatSingle(value, output.Slice(BytesPending), out int bytesWritten);
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Quote;
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Quote;
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
output[BytesPending++] = JsonConstants.Quote;
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
output[BytesPending++] = JsonConstants.Quote;
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = token;
}
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
output[BytesPending++] = token;
}
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = token;
}
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
output[BytesPending++] = token;
}
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
value.CopyTo(output.Slice(BytesPending));
BytesPending += value.Length;
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
value.CopyTo(output.Slice(BytesPending));
BytesPending += value.Length;
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
value.CopyTo(output.Slice(BytesPending));
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
value.CopyTo(output.Slice(BytesPending));
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
bool result = Utf8Formatter.TryFormat(value, output.Slice(BytesPending), out int bytesWritten);
Debug.Assert(result);
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
bool result = Utf8Formatter.TryFormat(value, output.Slice(BytesPending), out int bytesWritten);
Debug.Assert(result);
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
bool result = Utf8Formatter.TryFormat(value, output.Slice(BytesPending), out int bytesWritten);
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
bool result = Utf8Formatter.TryFormat(value, output.Slice(BytesPending), out int bytesWritten);
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
}
private void WriteStringIndentedPropertyName(ReadOnlySpan<char> escapedPropertyName)
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
}
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
}
// AggressiveInlining used since this is only called from one location.
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
}
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Quote;
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Quote;
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Quote;
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Quote;
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
output[BytesPending++] = JsonConstants.Quote;
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
output[BytesPending++] = JsonConstants.Quote;
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
output[BytesPending++] = JsonConstants.Quote;
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
output[BytesPending++] = JsonConstants.Quote;
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
bool result = Utf8Formatter.TryFormat(value, output.Slice(BytesPending), out int bytesWritten);
Debug.Assert(result);
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
bool result = Utf8Formatter.TryFormat(value, output.Slice(BytesPending), out int bytesWritten);
Debug.Assert(result);
TranscodeAndWrite(escapedPropertyName, output);
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
bool result = Utf8Formatter.TryFormat(value, output.Slice(BytesPending), out int bytesWritten);
BytesPending += escapedPropertyName.Length;
output[BytesPending++] = JsonConstants.Quote;
- output[BytesPending++] = JsonConstants.KeyValueSeperator;
+ output[BytesPending++] = JsonConstants.KeyValueSeparator;
output[BytesPending++] = JsonConstants.Space;
bool result = Utf8Formatter.TryFormat(value, output.Slice(BytesPending), out int bytesWritten);
public void EnsureHelperMethodGenerated_ImplicitPropertyFactory()
{
// ContextWithImplicitStringEnum does not have an entry for EnumWrittenAsString since it is
- // implictly added by PocoWithEnum. Verify helper methods are still being created properly.
+ // implicitly added by PocoWithEnum. Verify helper methods are still being created properly.
const string Json = "{\"MyEnum\":\"A\"}";
[InlineData(typeof(Interface))]
[InlineData(typeof(Class))]
[InlineData(typeof(GenericClass<int>))]
- public static void SupportedBaseTypeArgument_ShouldSucced(Type baseType)
+ public static void SupportedBaseTypeArgument_ShouldSucceed(Type baseType)
{
var configuration = new JsonPolymorphicTypeConfiguration(baseType);
Assert.Equal(baseType, configuration.BaseType);
[InlineData(typeof(Interface), typeof(Class))]
[InlineData(typeof(Interface), typeof(Struct))]
[InlineData(typeof(Class), typeof(GenericClass<int>))]
- public static void SupportedDerivedTypeArgument_ShouldSucced(Type baseType, Type derivedType)
+ public static void SupportedDerivedTypeArgument_ShouldSucceed(Type baseType, Type derivedType)
{
var configuration = new JsonPolymorphicTypeConfiguration(baseType).WithDerivedType(derivedType);
Assert.Equal(new[] { (derivedType, (string)null) }, configuration);
private class Class : Interface { }
private struct Struct : Interface { }
private sealed class SealedClass : Interface { }
- private class GenericClass<T> : Class { }
+ private class GenericClass<T> : Class { }
}
}
guint32 inserted_rows;
} delta_row_count;
-/* Additional informaiton for MonoImages representing deltas */
+/* Additional information for MonoImages representing deltas */
struct _DeltaInfo {
uint32_t generation; /* global update ID that added this delta image */
MonoImage *delta_image; /* DeltaInfo doesn't own the image, the base MonoImage owns the reference */
};
-/* Additional informaiton for baseline MonoImages */
+/* Additional information for baseline MonoImages */
struct _BaselineInfo {
/* List of DeltaInfos of deltas*/
GList *delta_info;
}
static gchar*
-strrchr_seperator (const gchar* filename)
+strrchr_separator (const gchar* filename)
{
#ifdef G_OS_WIN32
char *p2;
size_t count;
g_return_val_if_fail (filename != NULL, NULL);
- p = strrchr_seperator (filename);
+ p = strrchr_separator (filename);
if (p == NULL)
return g_strdup (".");
if (p == filename)
return g_strdup (".");
/* No separator -> filename */
- r = strrchr_seperator (filename);
+ r = strrchr_separator (filename);
if (r == NULL)
return g_strdup (filename);
if (r [1] == 0){
char *copy = g_strdup (filename);
copy [r-filename] = 0;
- r = strrchr_seperator (copy);
+ r = strrchr_separator (copy);
if (r == NULL){
g_free (copy);
* Scan token (scan for delimiters: s += strcspn(s, delim), sort of).
* Note that delim must have one NUL; we stop if we see that, too.
*/
- for (;;){
+ while (true) {
c = *s++;
spanp = (char *)delim;
do {
p = dir_utf16;
- /* make life easy and only use one directory seperator */
+ /* make life easy and only use one directory separator */
while (*p != '\0')
{
if (*p == '/')
return FAILED ("First element wasn't replaced with last upon removal");
if (g_ptr_array_remove_fast (array, letters[0]))
- return FAILED ("Succedeed removing a non-existing element");
+ return FAILED ("Succeeded removing a non-existing element");
if (!g_ptr_array_remove_fast (array, letters[3]) || array->len != 3)
return FAILED ("Failed removing \"D\"");
static Group test_groups [] = {
{"setup", ep_setup_tests_init},
{"rt", ep_rt_tests_init},
- {"fastserialzier", ep_fastserializer_tests_init},
+ {"fastserializer", ep_fastserializer_tests_init},
{"provider-callback-dataqueue", ep_provider_callback_data_queue_tests_init},
{"file", ep_file_tests_init},
{"session", ep_session_tests_init},
* vtable_slot_has_preserve_base_overrides_attribute:
*
* Needs to walk up the class hierarchy looking for the methods in this slot to
- * see if any are tagged with PreserveBaseOverrideAtrribute.
+ * see if any are tagged with PreserveBaseOverrideAttribute.
*/
static gboolean
vtable_slot_has_preserve_base_overrides_attribute (MonoClass *klass, int slot, MonoClass **out_klass)
// Hashtables for Reflection handles
MonoGHashTable *type_hash;
MonoConcGHashTable *refobject_hash;
- // Maps class -> type initializaiton exception object
+ // Maps class -> type initialization exception object
MonoGHashTable *type_init_exception_hash;
// Maps delegate trampoline addr -> delegate object
//MonoGHashTable *delegate_hash_table;
method = ((MonoMethodInflated *) method)->declaring;
signature = mono_method_signature_internal (method);
- /*FIXME this check is somewhat redundant since the caller usally will have to get the signature to figure out the
+ /*FIXME this check is somewhat redundant since the caller usually will have to get the signature to figure out the
number of arguments and allocate a properly sized array. */
if (signature == NULL)
return;
if (m_type_is_byref (t)) {
mono_mb_emit_byte (mb, CEE_LDIND_I);
/* A Nullable<T> type don't have a boxed form, it's either null or a boxed T.
- * So to make this work we unbox it to a local variablee and push a reference to that.
+ * So to make this work we unbox it to a local variable and push a reference to that.
*/
if (t->type == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type_internal (t))) {
tmp_nullable_locals [i] = mono_mb_add_local (mb, m_class_get_byval_arg (mono_class_from_mono_type_internal (t)));
* \param code_size memory location for returning the code size
* \param max_stack memory location for returning the max stack
*
- * Method header accessor to retreive info about the IL code properties:
+ * Method header accessor to retrieve info about the IL code properties:
* a pointer to the IL code itself, the size of the code and the max number
* of stack slots used by the code.
*
* \param num_locals memory location for returning the number of local variables
* \param init_locals memory location for returning the init_locals flag
*
- * Method header accessor to retreive info about the local variables:
+ * Method header accessor to retrieve info about the local variables:
* an array of local types, the number of locals and whether the locals
* are supposed to be initialized to 0 on method entry
*
* mono_method_header_get_num_clauses:
* @header: a MonoMethodHeader pointer
*
- * Method header accessor to retreive the number of exception clauses.
+ * Method header accessor to retrieve the number of exception clauses.
*
* Returns: the number of exception clauses present
*/
MonoArray *table_indexes;
} MonoReflectionModuleBuilder;
-/* Safely acess System.Reflection.Emit.ModuleBuidler from native code */
+/* Safely acess System.Reflection.Emit.ModuleBuilder from native code */
TYPED_HANDLE_DECL (MonoReflectionModuleBuilder);
typedef enum {
mono_class_set_field_def_values (klass, def_values);
/*
This is, guess what, a hack.
- The issue is that the runtime doesn't know how to setup the fields of a typebuider and crash.
+ The issue is that the runtime doesn't know how to setup the fields of a typebuilder and crash.
On the static path no field class is resolved, only types are built. This is the right thing to do
but we suck.
Setting size_inited is harmless because we're doing the same job as mono_class_setup_fields anyway.
* The first variable (the one "on the left of the expression") is implicit.
* relation: the relation between the variable and the value
* related_value: the related value
- * relation_is_static_definition: TRUE if the relation comes from a veriable
+ * relation_is_static_definition: TRUE if the relation comes from a variable
* definition, FALSE if it comes from a branch
* condition
* next: pointer to the next relation of this variable in the evaluation area
* - we use an approach similar to the x86 abi: reserve a register (r30) to hold
* the GOT pointer.
* - The full-aot trampolines need access to the GOT of mscorlib, so we store
- * in in the 2. slot of every GOT, and require every method to place the GOT
+ * it in the second slot of every GOT, and require every method to place the GOT
* address in r30, even when it doesn't access the GOT otherwise. This way,
* the trampolines can compute the mscorlib GOT address by loading 4(r30).
*/
/* get the basic block for the handler and
* check if the exception object is used.
* Flag is set during method_to_ir due to
- * pop-op is optmized away in codegen (burg).
+ * pop-op is optimized away in codegen (burg).
*/
tbb = cfg->cil_offset_to_bb [clause->handler_offset];
if (tbb && tbb->flags & BB_EXCEPTION_DEAD_OBJ && !(tbb->flags & BB_EXCEPTION_UNSAFE)) {
if (tree->inst_c1 == 32) {
/* The original code had this comment: */
- /* special case that gives a nice speedup and happens to workaorund a ppc jit but (for the release)
+ /* special case that gives a nice speedup and happens to workaround a ppc jit but (for the release)
* later apply the speedup to the left shift as well
* See BUG# 57957.
*/
if (ldobj_stobj (ref d1, ref d2) != 2.0)
return 3;
if (d1 != 2.0 || d2 != 0.0)
- return 4;
+ return 4;
return 0;
}
static void ldsflda<T> (int[] iarr) {
iarr [0] = GFoo<T>.static_f.i;
}
-
+
public static int test_0_stsfld () {
Foo[] farr = new Foo [] { new Foo () { i = 1, j = 2 } };
stsfld<Foo> (farr);
static GFoo3<T> newobj<T> (T t1, T t2) {
return new GFoo3<T> (t1, t2);
}
-
+
public static int test_0_gshared_new () {
var g1 = newobj (1, 2);
if (g1.t != 1 || g1.t2 != 2)
public T foo;
}
- [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void locals<T> (T t) {
Foo2<T> t2 = new Foo2<T> ();
object o = t2;
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
- static T2 rgctx_in_call_innner_inner<T1, T2> (T1 t1, T2 t2) {
+ static T2 rgctx_in_call_inner_inner<T1, T2> (T1 t1, T2 t2) {
return t2;
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
static GFoo3<T> rgctx_in_call_inner<T> (T t) {
- return rgctx_in_call_innner_inner (1, new GFoo3<T> ());
+ return rgctx_in_call_inner_inner (1, new GFoo3<T> ());
}
public static int test_0_rgctx_in_call () {
object o2 = a.bar<long> (1024, 0, o1);
if (o1 != o2)
return 1;
- return 0;
+ return 0;
}
interface BIFace {
}
}
- public static int test_0_nullable_unbox () {
+ public static int test_0_nullable_unbox () {
IFaceUnbox2 c = new ClassUnbox2 ();
int? i = c.unbox<int?> (5);
if (i != 5)
/*
* Constrained calls need to behave differently at runtime dependending on whenever the receiver is instantiated as ref type or as a vtype.
* This is hard to do with the current call code, since we would have to emit a branch and two different calls. So instead, we
- * pack the arguments into an array, and do the rest of the work in in an icall.
+ * pack the arguments into an array, and do the rest of the work in an icall.
*/
supported = ((cmethod->klass == mono_defaults.object_class) || mono_class_is_interface (cmethod->klass) || (!m_class_is_valuetype (cmethod->klass) && m_class_get_image (cmethod->klass) != mono_defaults.corlib));
if (supported)
if (!tailcall && !tailcall_calli)
goto exit;
- // FIXME in calli, there is no type for for the this parameter,
+ // FIXME in calli, there is no type for the this parameter,
// so we assume it might be valuetype; in future we should issue a range
// check, so rule out pointing to frame (for other reference parameters also)
gpointer addr;
/* The trampoline reads this, so keep the size explicit */
int ret_marshal;
- /* If ret_marshal != NONE, this is the reg of the vret arg, else -1 (used in out case) */
+ /* If ret_marshal != NONE, this is the reg of the vret arg, else -1 (used bu "out" case) */
/* Equivalent of vret_arg_slot in the x86 implementation. */
int vret_arg_reg;
- /* The stack slot where the return value will be stored (used in in case) */
+ /* The stack slot where the return value will be stored (used by "in" case) */
int vret_slot;
int stack_usage, map_count;
/* If not -1, then make a virtual call using this vtable offset */
#test variance with delegates
#generic methods
-#generic atributes
+#generic attributes
#generic delegates
#generic code
#the verifier must check if the generic instantiation is valid
./make_bool_branch_test.sh boolean_branch_${I}_4 valid ${OP} int64
./make_bool_branch_test.sh boolean_branch_${I}_5 valid ${OP} 'native int'
- #unmanaged pointers are not veriable types, all ops on unmanaged pointers are unverifiable
+ #unmanaged pointers are not verifiable types, all ops on unmanaged pointers are unverifiable
./make_bool_branch_test.sh boolean_branch_${I}_6 unverifiable ${OP} 'int32*'
./make_bool_branch_test.sh boolean_branch_${I}_8 unverifiable ${OP} 'method int32 *(int32)'
//
// This test merely creates a Win32Exception that triggers the
// code in mono/io-layer/message.c that validates that the
-// error table is propertly sorted
+// error table is properly sorted
using System;
using System.ComponentModel;
}
return true;
}
-
+
static int Main ()
{
//
return 0;
}
-
+
}
/*
* The following are used when detaching a thread. We need to pass the MonoThreadInfo*
- * as a paramater as the thread info TLS key is being destructed, meaning that
+ * as a parameter as the thread info TLS key is being destructed, meaning that
* mono_thread_info_current_unchecked will return NULL, which would lead to a
* runtime assertion error when trying to switch the state of the current thread.
*/
# dotnet.*.post.js
- Executed last (4)
- When `onRuntimeInitialized` is overriden it would wait for emscriptens `Module.ready`
-- Otherwise it would wait for for MonoVM to load all assets and assemblies.
+- Otherwise it would wait for MonoVM to load all assets and assemblies.
- It would pass on the API exports
# About new API
```
import createDotnetRuntime from './dotnet.js'
-export const { MONO, BINDING } = await createDotnetRuntime(({ MONO, BINDING, Module }) =>
+export const { MONO, BINDING } = await createDotnetRuntime(({ MONO, BINDING, Module }) =>
// this is callback with no statement, the APIs are only empty shells here and are populated later.
({
disableDotnet6Compatibility: true,
// Module.config is loaded and could be tweaked before application
Module.config.environment_variables["MONO_LOG_LEVEL"]="debug"
- // here we could use API passed into this callback
+ // here we could use API passed into this callback
// call some early available functions
MONO.mono_wasm_setenv("HELLO", "WORLD);
}
onDotnetReady: () => {
// Only when there is no `onRuntimeInitialized` override.
- // This is called after all assets are loaded , mapping to legacy `config.loaded_cb`.
- // It happens during emscripten `onRuntimeInitialized` after monoVm init + globalization + assemblies.
- // This also matches when the top level promise is resolved.
+ // This is called after all assets are loaded , mapping to legacy `config.loaded_cb`.
+ // It happens during emscripten `onRuntimeInitialized` after monoVm init + globalization + assemblies.
+ // This also matches when the top level promise is resolved.
// The original emscripten `Module.ready` promise is replaced with this.
// at this point both emscripten and monoVM are fully initialized.
// str - (out parameter) If the method returns true, contains the file path for this deps entry
// search_options - Flags to instruct where to look for this deps entry
// found_in_bundle - (out parameter) True if the candidate is located within the single-file bundle.
-//
+//
// Returns:
-// If the file exists in the path relative to the "base" directory within the
+// If the file exists in the path relative to the "base" directory within the
// single-file or on disk.
bool deps_entry_t::to_path(const pal::string_t& base, const pal::string_t& ietf_dir, pal::string_t* str, uint32_t search_options, bool &found_in_bundle) const
}
// If a file is resolved to the servicing directory, mark it as disabled in the bundle.
- // This step is necessary because runtime will try to resolve assemblies from the bundle
+ // This step is necessary because runtime will try to resolve assemblies from the bundle
// before it uses the TPA. So putting the servicing entry into TPA is not enough, since runtime would
// resolve it from the bundle first anyway. Disabling the file's entry in the bundle
// ensures that the servicing entry in the TPA gets priority.
//
// Parameters:
// base - The base directory to look for the relative path of this entry
-// str - If the method returns true, contains the file path for this deps entry
+// str - If the method returns true, contains the file path for this deps entry
// search_options - Flags to instruct where to look for this deps entry
// look_in_bundle - Whether to look within the single-file bundle
//
ietf_dir = get_directory(pal_relative_path);
// get_directory returns with DIR_SEPARATOR appended that we need to remove.
- remove_trailing_dir_seperator(&ietf_dir);
+ remove_trailing_dir_separator(&ietf_dir);
// Extract IETF code from "lib/<netstandrd_ver>/<ietf-code>"
ietf_dir = get_filename(ietf_dir);
//
// Parameters:
// base - The base directory to look for the relative path of this entry
-// str - If the method returns true, contains the file path for this deps entry
+// str - If the method returns true, contains the file path for this deps entry
// search_options - Flags to instruct where to look for this deps entry
//
// Returns:
//
// Parameters:
// base - The base directory to look for the relative path of this entry
-// str - If the method returns true, contains the file path for this deps entry
+// str - If the method returns true, contains the file path for this deps entry
// search_options - Flags to instruct where to look for this deps entry
//
// Returns:
else
{
// Check if we can extrapolate |arch|<DIR_SEPARATOR>|tfm| for probing stores
- // Check for for both forward and back slashes
+ // Check for both forward and back slashes
pal::string_t placeholder = _X("|arch|\\|tfm|");
auto pos_placeholder = probe_path.find(placeholder);
if (pos_placeholder == pal::string_t::npos)
bool dir_found = false;
if (pal::get_dotnet_self_registered_dir(&custom_dir))
{
- remove_trailing_dir_seperator(&custom_dir);
+ remove_trailing_dir_separator(&custom_dir);
dirs->push_back(custom_dir);
dir_found = true;
}
if (get_default_installation_dir(&default_dir))
{
- remove_trailing_dir_seperator(&default_dir);
+ remove_trailing_dir_separator(&default_dir);
// Avoid duplicate global dirs.
if (!dir_found || !are_paths_equal_with_normalized_casing(custom_dir, default_dir))
return ret.substr(0, static_cast<size_t>(pos) + 1) + DIR_SEPARATOR;
}
-void remove_trailing_dir_seperator(pal::string_t* dir)
+void remove_trailing_dir_separator(pal::string_t* dir)
{
if (dir->back() == DIR_SEPARATOR)
{
{
// own_dir contains DIR_SEPARATOR appended that we need to remove.
dotnet_dir_temp = dotnet_dir;
- remove_trailing_dir_seperator(&dotnet_dir_temp);
+ remove_trailing_dir_separator(&dotnet_dir_temp);
locations->push_back(dotnet_dir_temp);
}
void append_path(pal::string_t* path1, const pal::char_t* path2);
bool library_exists_in_dir(const pal::string_t& lib_dir, const pal::string_t& lib_name, pal::string_t* p_lib_path);
bool coreclr_exists_in_dir(const pal::string_t& candidate);
-void remove_trailing_dir_seperator(pal::string_t* dir);
+void remove_trailing_dir_separator(pal::string_t* dir);
void replace_char(pal::string_t* path, pal::char_t match, pal::char_t repl);
pal::string_t get_replaced_char(const pal::string_t& path, pal::char_t match, pal::char_t repl);
const pal::char_t* get_arch();
// Consuming the nethost as a static library
// Shouldn't export attempt to dllimport.
#ifdef NETHOST_USE_AS_STATIC
- #define NETHOST_API
+ #define NETHOST_API
#else
#define NETHOST_API __declspec(dllimport)
#endif
//
// get_hostfxr_parameters
// Optional. Parameters that modify the behaviour for locating the hostfxr library.
-// If nullptr, hostfxr is located using the enviroment variable or global registration
+// If nullptr, hostfxr is located using the environment variable or global registration
//
// Return value:
// 0 on success, otherwise failure
static
bool
-sample_profiler_load_dependecies (void);
+sample_profiler_load_dependencies (void);
static
void
-sample_profiler_unload_dependecies (void);
+sample_profiler_unload_dependencies (void);
static
void
static
bool
-sample_profiler_load_dependecies (void)
+sample_profiler_load_dependencies (void)
{
#ifdef HOST_WIN32
if (_ref_count > 0)
static
void
-sample_profiler_unload_dependecies (void)
+sample_profiler_unload_dependencies (void)
{
#ifdef HOST_WIN32
if (_multimedia_library_handle != NULL) {
if (!ep_event_is_enabled (_thread_time_event))
return;
- sample_profiler_load_dependecies ();
+ sample_profiler_load_dependencies ();
if (_can_start_sampling)
sample_profiler_enable ();
if (_time_period_is_set)
sample_profiler_reset_time_granularity ();
- sample_profiler_unload_dependecies ();
+ sample_profiler_unload_dependencies ();
}
--_ref_count;
// it's sibling is defined in https://github.com/Microsoft/perfview/blob/10d1f92b242c98073b3817ac5ee6d98cd595d39b/src/FastSerialization/FastSerialization.cs#L2295
typedef enum
{
- FAST_SERIALIZER_TAGS_ERROR = 0, // To improve debugabilty, 0 is an illegal tag.
+ FAST_SERIALIZER_TAGS_ERROR = 0, // To improve debugability, 0 is an illegal tag.
FAST_SERIALIZER_TAGS_NULL_REFERENCE = 1, // Tag for a null object forwardReference.
FAST_SERIALIZER_TAGS_OBJECT_REFERENCE = 2, // Followed by StreamLabel
// 3 used to belong to ForwardReference, which got removed in V3
static volatile SigChldCallback g_sigChldCallback = NULL;
static volatile bool g_sigChldConsoleConfigurationDelayed;
static void (*g_sigChldConsoleConfigurationCallback)(void);
-// Callback invoked for for SIGTTOU while terminal settings are changed.
+// Callback invoked for SIGTTOU while terminal settings are changed.
static volatile ConsoleSigTtouHandler g_consoleTtouHandler;
// Callback invoked for PosixSignal handling.
assert(origHandler->sa_handler);
origHandler->sa_handler(sig);
}
-
+
}
}
- isServer : true if the context should be created in server mode
- streamReader : callback for reading data from the connection
- streamWriter : callback for writing data to the connection
- - appBufferSize : initial buffer size for applicaiton data
+ - appBufferSize : initial buffer size for application data
Returns 1 on success, 0 otherwise
*/
nativeLibraries += $" {componentLibToLink}{Environment.NewLine}";
}
- // There's a circular dependecy between static mono runtime lib and static component libraries.
+ // There's a circular dependency between static mono runtime lib and static component libraries.
// Adding mono runtime lib before and after component libs will resolve issues with undefined symbols
- // due to circular dependecy.
+ // due to circular dependency.
nativeLibraries += $" {monoRuntimeLib}{Environment.NewLine}";
}
}
else
{
- // If previously compiled as R2R, treat as reference if this would be compiled seperately
+ // If previously compiled as R2R, treat as reference if this would be compiled separately
if (!compositeCompile || excludeFromComposite)
{
return Eligibility.CreateReferenceEligibility(excludeFromComposite);
#include <windows.h>
#include <combaseapi.h>
-#define FS_SEPERATOR L"\\"
-#define PATH_DELIMITER L";"
#define L(t) L##t
#define W(str) L##str
LPWSTR HackyConvertToWSTR(const char* pszInput);
-#define FS_SEPERATOR L("/")
-#define PATH_DELIMITER L(":")
#define L(t) HackyConvertToWSTR(t)
#define W(str) u##str
#define MAX_PATH 260
currLine = oldTests[j]
matchObj = re.search( r'[(.+)]', currLine)
if matchObj:
- nextLine = oldTests[j+1]
+ nextLine = oldTests[j+1]
matchObj = re.search( r'(RelativePath=)(.+)(\\)(.+)(.exe)', nextLine)
if matchObj:
relPath = matchObj.group(2)
if (relPath in exclusions):
# Skip to the next item. Currently each test consists of 7 lines.
removed += 1
- j += 7
+ j += 7
continue
newTestsHandle.write(currLine)
j += 1
print "Removed Tests: ", removed
- print newTestFile + " is successfuly built."
-
+ print newTestFile + " is successfully built."
file_handle.write("## Commit: %s\n" % ARGS.commit_hash)
file_handle.write("## \n")
- order = ["RelativePath", "WorkingDir", "Expected",
+ order = ["RelativePath", "WorkingDir", "Expected",
"MaxAllowedDurationSeconds", "Categories", "HostStyle"]
def write_metadata(data, count=None):
with open(failures_csv, "r") as file_handle:
lines = file_handle.readlines()
-
+
try:
for line in lines:
split = line.split(",")
working_directory = os.path.dirname(test_name).replace("/", "\\")
- # Make sure the tests use the windows \ seperator.
+ # Make sure the tests use the windows \ separator.
relative_path = test_name.replace("/", "\\")
max_duration = "600"
-
+
if priority == 0:
categories = "EXPECTED_PASS"
else:
categories = "EXPECTED_PASS;Pri%d" % priority
-
+
expected = "0"
host_style = "0"
: cmd file under the base_dir.
Note:
- To find the tests correctly you must build the tests correctly and
- pass that directory. This method will NOT check to make sure that
+ To find the tests correctly you must build the tests correctly and
+ pass that directory. This method will NOT check to make sure that
this has been done correctly.
This is a recursive method.
print
priority_marked_tests = defaultdict(lambda: None)
-
+
for test in pri1_tests:
priority_marked_tests[test] = 1
for test in pri0_tests:
using System;
-class enviroment_version
+class environment_version
{
static int Main()
{
IntPtr handle = NativeLibrary.Load(NativeLibraryToLoad.GetFullPath());
try
{
- // NativeLibrary does not load symbols globally, so we shouldn't be able to discover symbols from libaries loaded
- // with NativeLibary.Load.
+ // NativeLibrary does not load symbols globally, so we shouldn't be able to discover symbols from libraries loaded
+ // with NativeLibrary.Load.
EXPECT(GetSymbolFromMainProgramHandle("LocallyLoadedNativeLib", TestLibrary.Utilities.IsX86 ? "_NativeSum@8" : "NativeSum"), TestResult.ReturnFailure);
EXPECT(GetSymbolFromMainProgramHandle("LocallyLoadedNativeLib", "NonNativeSum"), TestResult.ReturnFailure);
EXPECT(LoadLibrary_NameOnly(libName), TestResult.DllNotFound);
EXPECT(TryLoadLibrary_NameOnly(libName), TestResult.ReturnFailure);
}
-
+
[Fact]
public void LoadLibraryOnInvalidFile_NameOnly()
{
EXPECT(TryLoadLibrary_WithAssembly(libName, assembly, null), TestResult.ReturnFailure);
}
- public static bool HasKnownLibraryInSystemDirectory =>
+ public static bool HasKnownLibraryInSystemDirectory =>
OperatingSystem.IsWindows()
&& File.Exists(Path.Combine(Environment.SystemDirectory, "url.dll"));
}
[Fact]
- public void LoadLibary_UsesFullPath_EvenWhen_AssemblyDirectory_Specified()
+ public void LoadLibrary_UsesFullPath_EvenWhen_AssemblyDirectory_Specified()
{
string libName = Path.Combine(testBinDir, Path.Combine("lib", NativeLibraryToLoad.Name));
EXPECT(LoadLibrary_WithAssembly(libName, assembly, DllImportSearchPath.AssemblyDirectory), TestResult.DllNotFound);
}
else if (!actualSize.Equals(expectedSize))
{
- Console.WriteLine("\tTwo array are not equal.The sizes are not equal:Expected:{0},Actaul:{1}", expectedSize, actualSize);
+ Console.WriteLine("\tTwo array are not equal.The sizes are not equal. Expected: {0}, Actual: {1}", expectedSize, actualSize);
return false;
}
for (int i = 0; i < expectedSize; ++i)
}
}
- // Variant with code written awkwardly but which acheives the desired
+ // Variant with code written awkwardly but which achieves the desired
// performance if JIT simply lays out code in source order.
public static bool LoopGoto(String strA, String strB)
{
// RunBenchmark - .NET Benchmark Performance Harness
//
// Note: This harness is currently built as a CoreCLR test case for ease of running
-// against test CORE_ROOT assemblies. As such, when run with out any parameters,
+// against test CORE_ROOT assemblies. As such, when run with out any parameters,
// it will do nothing and simply return 100. Use "-run" to actually run tests cases.
//
// Usage: RunBenchmarks [options]
-//
+//
// options:
-//
+//
// -f <xmlFile> specify benchmark xml control file (default benchmarks.xml)
// -n <number> specify number of runs for each benchmark (default is 1)
// -w specify that warmup run should be done first
// -norun prints what would be run, but don't run benchmarks
// -tags <tags> specify benchmarks with tags to include
// -notags <tags> specify benchmarks with tags to exclude
-// -csvfile specify name of Comma Seperated Value output file (default console)
+// -csvfile specify name of Comma Separated Value output file (default console)
//
// Benchmark .XML Control File format:
//
// Benchmark Results - includes benchmark, array of times for each iteration of the benchmark
// minimum time, maximum time, average time, standard deviation and number
// of failures.
-
+
internal class Results
{
public Benchmark Benchmark;
}
}
- // Controls - command line controls used to
+ // Controls - command line controls used to
internal class Controls
{
Console.WriteLine(" -norun prints what would be run, but don't run benchmarks");
Console.WriteLine(" -tags <tags> specify benchmarks with tags to include");
Console.WriteLine(" -notags <tags> specify benchmarks with tags to exclude");
- Console.WriteLine(" -csvfile specify name of Comma Seperated Value output file (default coreclr_benchmarks.csv)");
+ Console.WriteLine(" -csvfile specify name of Comma Separated Value output file (default coreclr_benchmarks.csv)");
Exit(-1);
}
// Constructed platform specific field name given either Unix style or Windows style
// directory name.
-
+
public string PlatformSpecificDirectoryName
(
string directoryName
// If we aren't being asked to run benchmarks or print results
// then we must be being executed as a simple CoreCLR test case.
// Don't bother reading XML file.
-
+
if (doRunAsTestCase)
{
return;
XElement benchmarkXml = XElement.Load(benchmarkXmlFullFileName);
- // Get root directory for benchmark system. Command line argument overrides
+ // Get root directory for benchmark system. Command line argument overrides
// specification in benchmark control file.
benchmarkRootDirectoryName = Controls.BenchmarksRootDirectory;
if (benchmarkRootDirectoryName == "")
{
- benchmarkRootDirectoryName =
+ benchmarkRootDirectoryName =
Controls.BenchmarksRootDirectory = benchmarkRootDirectoryName;
}
benchmarkRootDirectoryName = PlatformSpecificDirectoryName(benchmarkRootDirectoryName);
}
}
- // Select benchmarks to run based on controls for suite, tag, or specfic
+ // Select benchmarks to run based on controls for suite, tag, or specfic
// benchmark inclusion/exclusion.
public void SelectBenchmarks()
{
string name = results.Benchmark.Name;
outputFile.Write("{0},", name);
-
+
long minimum = results.Minimum;
long maximum = results.Maximum;
long average = results.Average;
double standardDeviation = results.StandardDeviation;
outputFile.Write("{0},{1},{2},{3}", minimum, maximum, average, standardDeviation);
-
+
numberOfFailuresPerBenchmark = results.Failures;
numberOfPasses = (numberOfPasses < 0) ? 0 : numberOfPasses;
if (numberOfFailuresPerBenchmark > 0)
}
outputFile.WriteLine("");
}
-
+
outputFile.WriteLine("TOTAL BENCHMARKS({0}), PASSED({1}), FAILED({2})",
numberOfBenchmarksRun, numberOfPasses, numberOfFailures);
}
public static void Run(Action action)
{
- //We need to allocate the object inside of a seperate method to ensure that
+ //We need to allocate the object inside of a separate method to ensure that
//the reference will be eliminated before GC.Collect is called. Technically
//even across methods we probably don't make any formal guarantees but this
//is sufficient for current runtime implementations.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
static extern int CaptureComPointer(IComInterface foo);
[DllImport("ComWrappersNative", CallingConvention = CallingConvention.StdCall)]
- static extern int RetreiveCapturedComPointer(out IComInterface foo);
+ static extern int RetrieveCapturedComPointer(out IComInterface foo);
- [DllImport("ComWrappersNative", EntryPoint="RetreiveCapturedComPointer", CallingConvention = CallingConvention.StdCall)]
- static extern int RetreiveCapturedComPointerRaw(out IntPtr foo);
+ [DllImport("ComWrappersNative", EntryPoint="RetrieveCapturedComPointer", CallingConvention = CallingConvention.StdCall)]
+ static extern int RetrieveCapturedComPointerRaw(out IntPtr foo);
[DllImport("ComWrappersNative", CallingConvention = CallingConvention.StdCall)]
static extern void ReleaseComPointer();
var target = new ComObject();
int result = CaptureComPointer(target);
ThrowIfNotEquals(0, result, "Seems to be COM marshalling behave strange.");
- result = RetreiveCapturedComPointerRaw(out var comPtr);
+ result = RetrieveCapturedComPointerRaw(out var comPtr);
var roundTripObject = GlobalComWrappers.GetOrCreateObjectForComInstance(comPtr, CreateObjectFlags.Unwrap);
ThrowIfNotEquals(0, result, "Seems to be COM marshalling behave strange.");
if (roundTripObject != target)
var target = new ComObject();
int result = CaptureComPointer(target);
ThrowIfNotEquals(0, result, "Seems to be COM marshalling behave strange.");
- result = RetreiveCapturedComPointer(out var capturedObject);
+ result = RetrieveCapturedComPointer(out var capturedObject);
ThrowIfNotEquals(0, result, "Seems to be COM marshalling behave strange.");
if (capturedObject != target)
{
return capturedComObject->DoWork(11);
}
-DLL_EXPORT int __stdcall RetreiveCapturedComPointer(IComInterface** ppUnk)
+DLL_EXPORT int __stdcall RetrieveCapturedComPointer(IComInterface** ppUnk)
{
*ppUnk = capturedComObject;
return S_OK;
public class UCGSamples<T, U> : Base
{
public T[] _elements = new T[10];
-
+
public T member;
-
+
public T getMember() { return this.member; }
public override object GetElementAt(int index)
_elements[index] = (T)value;
}
}
-
+
private void Empty(T t, T u)
{
}
-
+
public override void nestedTest()
{
testMethodInner();
//testMethodInner2();
testMethodInner3();
}
-
+
private MyGenStruct<UCGSamples<T,U>> testMethodInner()
{
return default(MyGenStruct<UCGSamples<T,U>>);
{
return default(MyGenStruct<MyGenStruct<UCGSamples<T,U>>>);
}
-
+
public override bool EmptyMethodTest(object param)
{
T t = (T) param;
Empty(t, t);
return true;
}
-
+
private T dupTestInternal(T t1, T t2)
{
// IL for this method uses a 'dup' opcode
{
local = t2;
}
- return local;
+ return local;
}
-
+
public override object dupTest(object o1, object o2)
{
return (object) dupTestInternal((T) o1, (T) o2);
}
-
+
private void set(T t)
{
member = t;
}
-
+
private void setEQ(T t1, T t2)
{
t2 = t1;
}
-
+
private void setByRefInner(T t, ref T tRef)
{
tRef = t;
- }
-
+ }
+
[MethodImpl(MethodImplOptions.NoInlining)]
private void setInner(T t1, T t2)
{
t1 = t2;
}
-
+
[MethodImpl(MethodImplOptions.NoInlining)]
private void setOuter(T t1, T t2)
{
setInner(t1, t2);
}
-
+
private void setByRef(T t, ref T tRef)
{
setByRefInner(t, ref tRef);
}
-
+
public override bool FunctionCallTestsSetMember(object o1)
{
// eventually calls this.set(T) which sets this.member
set(t);
return this.member.Equals(t) && t.Equals(this.getMember());
}
-
+
public override bool FunctionCallTestsSetMemberByRef(object o1)
{
// same as 'FunctionCallTestsSetMember', but sets this.member via passing it byref
setByRef(t, ref this.member);
return this.member.Equals(t);
}
-
+
public override bool FunctionCallTestsSetByValue(object o1)
{
// Calls setEQ, which sets second arg equal to first
setEQ(t, this.member);
return !this.member.Equals(t);
}
-
+
public override bool FunctionCallTestsSetLocalByRef(object o1)
{
// same as 'FunctionCallTests', but sets a local via passing it byref
return !this.member.Equals(t);
}
}
-
+
public class InterlockedClass<T, U> : Base where T : class
{
T member= default(T);
this.setMember((T)o1);
T ret = this.exchangeTest((T)o2);
Assert.IsTrue(ret.Equals(o1));
-
+
this.setMember((T)o1);
Assert.IsTrue(this.member.Equals((T) o1));
ret = this.compareExchangeTest((T)o2);
- Assert.IsTrue(ret.Equals(o1));
+ Assert.IsTrue(ret.Equals(o1));
}
}
-
+
public class Test
{
[TestMethod]
Base o = (Base)Activator.CreateInstance(t);
o.InterlockedTests((object)"abc", (object)"def");
}
-
+
[TestMethod]
public static void TestArraysAndGC()
{
Assert.IsTrue(o.EmptyMethodTest((short) 45));
Assert.AreEqual((short)o.dupTest((short)12, (short)-453),
(short)12);
-
- o.nestedTest();
-
+
+ o.nestedTest();
+
Assert.IsTrue(o.FunctionCallTestsSetMember((short) 79));
Assert.IsTrue(o.FunctionCallTestsSetMemberByRef((short) 85));
Assert.IsTrue(o.FunctionCallTestsSetByValue((short) 138));
Assert.IsTrue(o.FunctionCallTestsSetLocalByRef((short) 19));
Assert.IsTrue(o.FunctionCallTestsSetByValue2((short) 99));
-
+
for (int i = 0; i < 10; i++)
{
// No explicit typecasts
Assert.AreEqual(((short)o.GetElementAt(i)).ToString(), val.ToString());
}
}
-
+
[TestMethod]
public static void TestMakeGenericType()
{
{
// In this test, we set values using static code, and the universal shared generic is supposed to read from
// the same static variables
-
+
// Test with primitive types as field types
TestFieldsBase o = new UCGStaticFieldsLayoutCompatStatic<int, int>();
o.SetVal1(10);
public virtual void TestVirtualCall3(object o, bool TAndUAreTheSame, string instTypeName) { }
public virtual void TestVirtualCall4(object o, string instTypeName) { }
}
-
+
public class UCGTestVirtualCalls<T, U> : TestVirtualCallsBase
{
public override void TestVirtualCall0(object o)
Assert.IsTrue(result == (short)123);
}
-
+
[TestMethod]
public static void TestVirtualCalls()
{
public virtual object TestNonVirtualInstanceFunction(object o, object value) { return null; }
}
- public class UCGSeperateClass<T>
+ public class UCGSeparateClass<T>
{
[MethodImpl(MethodImplOptions.NoInlining)]
public object BoxParam(T t)
{
public override object TestNonVirtualInstanceFunction(object o, object value)
{
- return ((UCGSeperateClass<T>)o).BoxParam((T)value);
+ return ((UCGSeparateClass<T>)o).BoxParam((T)value);
}
}
}
}
-
+
[TestMethod]
public static void TestCallInstanceFunction()
{
var t = TypeOf.CCT_UCGTestNonVirtualFunctionCallUse.MakeGenericType(TypeOf.Short);
TestNonVirtualFunctionCallUseBase o = (TestNonVirtualFunctionCallUseBase)Activator.CreateInstance(t);
- new UCGSeperateClass<short>().BoxParam(4);
+ new UCGSeparateClass<short>().BoxParam(4);
short testValue = (short)3817;
- object returnValue = o.TestNonVirtualInstanceFunction(new UCGSeperateClass<short>(), (object)testValue);
+ object returnValue = o.TestNonVirtualInstanceFunction(new UCGSeparateClass<short>(), (object)testValue);
Assert.AreEqual(testValue, (short)returnValue);
}
// SimpleMethod2
{
MethodInfo simpleMethod2 = t.GetTypeInfo().GetDeclaredMethod("SimpleMethod2");
- object[] args = new object[] {
- 123,
- "456",
- new Dictionary<object, string>(),
+ object[] args = new object[] {
+ 123,
+ "456",
+ new Dictionary<object, string>(),
new List<float>(new float[]{1.2f, 3.4f, 5.6f})
};
public X x;
public Y y;
public Z z;
-
+
// This forces recursive type layout to ensure that we come up with a sensible result.
public static GenStructDynamic<X, Y, Z> test;
}
return t.GetType();
}
}
-
+
public class Test
{
s_staticClass.x = s_dynamicClass.x;
s_staticClass.y = s_dynamicClass.y;
s_staticClass.z = s_dynamicClass.z;
-
+
GenStructDynamic<sbyte, sbyte, sbyte>.test.x = 0;
Type staticType = null;
s_dynamicStruct.x = s_staticStruct.x;
s_dynamicStruct.y = s_staticStruct.y;
s_dynamicStruct.z = s_staticStruct.z;
-
+
Type staticType = null;
Type dynamicType = null;
staticType = typeof(GenStructStatic<short, double, double>);
dynamicType = typeof(GenStructDynamic<,,>).MakeGenericType(TypeOf.Int16, TypeOf.Double, TypeOf.Double);
AssertTypesSimilar(staticType, dynamicType);
-
+
// top level int
// mid level bool
staticType = typeof(GenStructStatic<int, bool, bool>);
staticType = typeof(GenStructStatic<int, double, double>);
dynamicType = typeof(GenStructDynamic<,,>).MakeGenericType(TypeOf.Int32, TypeOf.Double, TypeOf.Double);
AssertTypesSimilar(staticType, dynamicType);
-
+
// top level double
// mid level bool
staticType = typeof(GenStructStatic<double, bool, bool>);
public ReferenceType() { _field = "ReferenceType.ctor"; }
public override string ToString() { return _field; }
}
- public class GenReferenceType<T>
+ public class GenReferenceType<T>
{
string _field;
public GenReferenceType() { _field = "GenReferenceType<" + typeof(T) + ">.ctor"; }
}
- public class Base
- {
+ public class Base
+ {
public virtual string Func() { return null; }
}
public class ACI_Instantiator<T, U> : Base
TestActivatorCreateInstance_Inner(TypeOf.ACI_GenReferenceTypeNoDefaultCtor.MakeGenericType(TypeOf.Double), null, true);
TestActivatorCreateInstance_Inner(typeof(GenReferenceTypeNoDefaultCtor<CommonType1>), null, true);
- TestActivatorCreateInstance_Inner(typeof(AValueType), "AValueType.ctor00");
+ TestActivatorCreateInstance_Inner(typeof(AValueType), "AValueType.ctor00");
TestActivatorCreateInstance_Inner(TypeOf.ACI_AGenValueType.MakeGenericType(TypeOf.String), "AGenValueType<System.String>.ctor");
TestActivatorCreateInstance_Inner(TypeOf.ACI_AGenValueType.MakeGenericType(TypeOf.Double), "AGenValueType<System.Double>.ctor0");
#if USC
return typeof(T).ToString();
}
}
-
+
//
- // Test USG reflection heuristics by using an rd.xml entry to root the type.
+ // Test USG reflection heuristics by using an rd.xml entry to root the type.
// Only look up the type with Type.GetType(string) so it is never statically referenced.
//
public struct OnlyUseViaReflection<T>
{
T _a;
-
+
public OnlyUseViaReflection(int dummyToMakeCscPass) { _a = default(T); }
public override string ToString() { return "OnlyUseViaReflection<" + typeof(T) + ">.ctor" + _a; }
public string GenericMethodNotCalledStatically<U>(U u)
return typeof(U).ToString();
}
}
-
+
public class OnlyUseViaReflectionGenMethod
{
public string GenericMethodNotCalledStatically<T>(T t)
return typeof(T).ToString();
}
}
-
+
public class TestHeuristics
{
[TestMethod]
t = TypeOf.OnlyUseViaReflection.MakeGenericType(TypeOf.Double);
Object o = Activator.CreateInstance(t);
Assert.IsTrue(o != null);
-
+
t = TypeOf.OnlyUseViaReflectionGenMethod;
Object obj = Activator.CreateInstance(t);
Assert.IsTrue(obj != null);
}
-
+
//
// Try instantiating all reflectable generics in this test app over a specific value type to ensure
// everything marked reflectable works with USG
{
public string RunTest(object input_obj, int testId)
{
- // These typecases will cause RhTypeCast_IsInstanceOfInterface to execute,
+ // These typecases will cause RhTypeCast_IsInstanceOfInterface to execute,
// which will check for variance equalities between types.
IEnumerable<T> source = input_obj as IEnumerable<T>;
ICollection<T> collection = source as ICollection<T>;
}
public interface IMyComparer<T> { }
- public class MyComparer<T> : IMyComparer<T>
+ public class MyComparer<T> : IMyComparer<T>
{
public override string ToString() { return "MyComparer<" + typeof(T) + ">"; }
}
int actualResult = 0;
bool actualThrow = false;
-
+
try
{
actualResult = e.Compare(x,y);
// Test not using default parameter
result = del.DynamicInvoke(new object[]{ (object)(short)3, 5});
- Assert.AreEqual(result, 5);
+ Assert.AreEqual(result, 5);
}
}
}
echo off
-setlocal
+setlocal
set TESTDIR=%~dp0\..\..\..\..\..\..\artifacts\tests\coreclr\windows.x64.Debug\readytorun\crossboundarylayout\crossboundarytest\crossboundarytest
set TESTBATCHROOT=%~dp0
goto done
:testCG2SingleInputBubbleCompiledWithoutReferenceToBCE
-echo TEST All combinations of the 5 dlls compiled with Crossgen2 with input bubble enabled and all assemblies passed as
-echo reference inputs to crossgen2 when compiled b, crossboundarytest and e. a, and d are compiled with the reference
+echo TEST All combinations of the 5 dlls compiled with Crossgen2 with input bubble enabled and all assemblies passed as
+echo reference inputs to crossgen2 when compiled b, crossboundarytest and e. a, and d are compiled with the reference
echo set limited to a and d. This simulates a the model of two different sets of input bubble matched assemblies where there is a
-echo root set such as the runtime repo worth of libraries, and a seperately compiled application set.
+echo root set such as the runtime repo worth of libraries, and a separately compiled application set.
call %TESTBATCHROOT%\runindividualtest.cmd %TESTBATCHROOT% %TESTDIR% cg2bubble2_A____ a CG2SingleBubbleADOnly d CG2NoMethods
call %TESTBATCHROOT%\runindividualtest.cmd %TESTBATCHROOT% %TESTDIR% cg2bubble2__B___ b CG2SingleInputBubble a CG2NoMethods d CG2NoMethods e CG2NoMethods
:testCG2SingleMixedInputBubble
echo TEST All combinations of the 5 dlls compiled with Crossgen2 with input bubble enabled for the root set and not
-echo for the more derived set of assemblies. b, crossboundarytest, and e are compiled as standard R2R and
+echo for the more derived set of assemblies. b, crossboundarytest, and e are compiled as standard R2R and
echo a, and d are compiled with the reference echo set limited to a and d with input bubble enabled. This simulates a the model
echo of a framework that ships with input bubble enabled, and the application with standard R2R rules.
:: Note: We've disabled node reuse because it causes file locking issues.
:: The issue is that we extend the build with our own targets which
-:: means that that rebuilding cannot successfully delete the task
+:: means that rebuilding cannot successfully delete the task
:: assembly.
set __msbuildCommonArgs=/nologo /nodeReuse:false %__msbuildExtraArgs% /p:Platform=%__MSBuildBuildArch%
if (s_dotnetExe == null)
{
- if(!String.IsNullOrEmpty(options.CoreLibariesDirectory))
+ if(!String.IsNullOrEmpty(options.CoreLibrariesDirectory))
{
- Console.WriteLine($"** Using core libraries found at {options.CoreLibariesDirectory}");
- s_corelibsDir = new DirectoryInfo(options.CoreLibariesDirectory);
+ Console.WriteLine($"** Using core libraries found at {options.CoreLibrariesDirectory}");
+ s_corelibsDir = new DirectoryInfo(options.CoreLibrariesDirectory);
}
else
{
}
}
- [Option("corelibs", Required = false, HelpText = "Specifies the location of .NET Core libaries to patch into dotnet. Cannot be used with --dotnet")]
- public string CoreLibariesDirectory
+ [Option("corelibs", Required = false, HelpText = "Specifies the location of .NET Core libraries to patch into dotnet. Cannot be used with --dotnet")]
+ public string CoreLibrariesDirectory
{
get { return _corelibsDir; }
}
});
- if (options != null && !String.IsNullOrEmpty(options.DotnetExecutable) && !String.IsNullOrEmpty(options.CoreLibariesDirectory))
+ if (options != null && !String.IsNullOrEmpty(options.DotnetExecutable) && !String.IsNullOrEmpty(options.CoreLibrariesDirectory))
{
throw new ArgumentException("--dotnet and --corlibs cannot be used together");
}