var pinCount = eventTypes.pinCount;
var scratch = stackalloc byte[eventTypes.scratchSize];
var descriptors = stackalloc EventData[eventTypes.dataCount + 3];
+
var pins = stackalloc GCHandle[pinCount];
+ for (int i = 0; i < pinCount; i++)
+ pins[i] = default(GCHandle);
fixed (byte*
pMetadata0 = this.providerMetadata,
var pinCount = eventTypes.pinCount;
var scratch = stackalloc byte[eventTypes.scratchSize];
var descriptors = stackalloc EventData[eventTypes.dataCount + 3];
+
var pins = stackalloc GCHandle[pinCount];
+ for (int i = 0; i < pinCount; i++)
+ pins[i] = default(GCHandle);
fixed (byte*
pMetadata0 = this.providerMetadata,
{
DataCollector.ThreadInstance.Disable();
- for (int i = 0; i != cPins; i++)
+ for (int i = 0; i < cPins; i++)
{
- if (IntPtr.Zero != (IntPtr)pPins[i])
+ if (pPins[i].IsAllocated)
{
pPins[i].Free();
}
const uint LCMAP_SORTHANDLE = 0x20000000;
- long handle;
+ IntPtr handle;
int ret = Interop.Kernel32.LCMapStringEx(_textInfoName, LCMAP_SORTHANDLE, null, 0, &handle, IntPtr.Size, null, null, IntPtr.Zero);
- _sortHandle = ret > 0 ? (IntPtr)handle : IntPtr.Zero;
+ _sortHandle = ret > 0 ? handle : IntPtr.Zero;
}
private unsafe string ChangeCase(string s, bool toUpper)
bool fILIntrinsic = false;
MethodTable * pMT = ftn->GetMethodTable();
-
- if (MscorlibBinder::IsClass(pMT, CLASS__JIT_HELPERS))
- {
- fILIntrinsic = getILIntrinsicImplementation(ftn, methInfo);
- }
- else if (MscorlibBinder::IsClass(pMT, CLASS__UNSAFE))
- {
- fILIntrinsic = getILIntrinsicImplementationForUnsafe(ftn, methInfo);
- }
- else if (MscorlibBinder::IsClass(pMT, CLASS__INTERLOCKED))
- {
- fILIntrinsic = getILIntrinsicImplementationForInterlocked(ftn, methInfo);
- }
- else if (MscorlibBinder::IsClass(pMT, CLASS__VOLATILE))
- {
- fILIntrinsic = getILIntrinsicImplementationForVolatile(ftn, methInfo);
- }
- else if (MscorlibBinder::IsClass(pMT, CLASS__RUNTIME_HELPERS))
+
+ if (pMT->GetModule()->IsSystem())
{
- fILIntrinsic = getILIntrinsicImplementationForRuntimeHelpers(ftn, methInfo);
+ if (MscorlibBinder::IsClass(pMT, CLASS__JIT_HELPERS))
+ {
+ fILIntrinsic = getILIntrinsicImplementation(ftn, methInfo);
+ }
+ else if (MscorlibBinder::IsClass(pMT, CLASS__UNSAFE))
+ {
+ fILIntrinsic = getILIntrinsicImplementationForUnsafe(ftn, methInfo);
+ }
+ else if (MscorlibBinder::IsClass(pMT, CLASS__INTERLOCKED))
+ {
+ fILIntrinsic = getILIntrinsicImplementationForInterlocked(ftn, methInfo);
+ }
+ else if (MscorlibBinder::IsClass(pMT, CLASS__VOLATILE))
+ {
+ fILIntrinsic = getILIntrinsicImplementationForVolatile(ftn, methInfo);
+ }
+ else if (MscorlibBinder::IsClass(pMT, CLASS__RUNTIME_HELPERS))
+ {
+ fILIntrinsic = getILIntrinsicImplementationForRuntimeHelpers(ftn, methInfo);
+ }
}
if (!fILIntrinsic)
{
getMethodInfoILMethodHeaderHelper(header, methInfo);
+
+ // Workaround for https://github.com/dotnet/coreclr/issues/1279
+ // Set init locals bit to zero for system module unless profiler may have overrided it. Remove once we have
+ // better solution for this issue.
+ if (pMT->GetModule()->IsSystem() && !(CORProfilerDisableAllNGenImages() || CORProfilerUseProfileImages()))
+ methInfo->options = (CorInfoOptions)0;
+
pLocalSig = header->LocalVarSig;
cbLocalSig = header->cbLocalVarSig;
}