Imported Upstream version 4.8.0.309

Former-commit-id: 5f9c6ae75f295e057a7d2971f3a6df4656fa8850
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2016-11-10 13:04:39 +00:00
parent ee1447783b
commit 94b2861243
4912 changed files with 390737 additions and 49310 deletions

View File

@@ -3,6 +3,15 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
// There are cases where we have multiple assemblies that are going to import this file and
// if they are going to also have InternalsVisibleTo between them, there will be a compiler warning
// that the type is found both in the source and in a referenced assembly. The compiler will prefer
// the version of the type defined in the source
//
// In order to disable the warning for this type we are disabling this warning for this entire file.
#pragma warning disable 436
using System;
using System.Collections.Generic;
@@ -167,3 +176,5 @@ namespace System
static partial void PopulateDefaultValuesPartial(string platformIdentifier, string profile, int version);
}
}
#pragma warning restore 436

View File

@@ -4,6 +4,14 @@
//
// ==--==
// There are cases where we have multiple assemblies that are going to import this file and
// if they are going to also have InternalsVisibleTo between them, there will be a compiler warning
// that the type is found both in the source and in a referenced assembly. The compiler will prefer
// the version of the type defined in the source
//
// In order to disable the warning for this type we are disabling this warning for this entire file.
#pragma warning disable 436
// NOTE: This file should not be included in mscorlib. This should only be included in FX libraries that need to provide switches
using System;
using System.Collections.Generic;
@@ -126,3 +134,5 @@ namespace System
}
}
}
#pragma warning restore 436

View File

@@ -155,7 +155,14 @@ namespace System
if (PinnableBufferCacheEventSource.Log.IsEnabled())
PinnableBufferCacheEventSource.Log.FreeBuffer(m_CacheName, PinnableBufferCacheEventSource.AddressOf(buffer), buffer.GetHashCode(), m_FreeList.Count);
if(buffer == null)
{
if (PinnableBufferCacheEventSource.Log.IsEnabled())
PinnableBufferCacheEventSource.Log.FreeBufferNull(m_CacheName, m_FreeList.Count);
return;
}
// After we've done 3 gen1 GCs, assume that all buffers have aged into gen2 on the free path.
if ((m_gen1CountAtLastRestock + 3) > GC.CollectionCount(GC.MaxGeneration - 1))
{
@@ -567,6 +574,7 @@ namespace System
public void AllocateBufferAged(string cacheName, int agedCount) {}
public void AllocateBufferFreeListEmpty(string cacheName, int notGen2CountBefore) {}
public void FreeBuffer(string cacheName, ulong objectId, int objectHash, int freeCountBefore) {}
public void FreeBufferNull(string cacheName, int freeCountBefore) { }
public void FreeBufferStillTooYoung(string cacheName, int notGen2CountBefore) {}
public void TrimCheck(string cacheName, int totalBuffs, bool neededMoreThanFreeList, int deltaMSec) {}
public void TrimFree(string cacheName, int totalBuffs, int freeListCount, int toBeFreed) {}
@@ -643,6 +651,8 @@ namespace System
public void AgePendingBuffersResults(string cacheName, int promotedToFreeListCount, int heldBackCount) { if (IsEnabled()) WriteEvent(20, cacheName, promotedToFreeListCount, heldBackCount); }
[Event(21)]
public void WalkFreeListResult(string cacheName, int freeListCount, int gen0BuffersInFreeList) { if (IsEnabled()) WriteEvent(21, cacheName, freeListCount, gen0BuffersInFreeList); }
[Event(22)]
public void FreeBufferNull(string cacheName, int freeCountBefore) { if(IsEnabled()) WriteEvent(22, cacheName, freeCountBefore); }
static internal ulong AddressOf(object obj)