This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@pushd bin\Release\netcoreapp2.0\win7-x64\publish | |
rem !!! 2.0.0-preview2-002093-00 version below needs to be updated to the version actually used by the app !!! | |
copy %userprofile%\.nuget\packages\runtime.win-x64.microsoft.netcore.app\2.0.0-preview2-002093-00\tools\crossgen.exe | |
@FOR %%I in (*.dll) DO call :RunCrossGen %%~nI | |
del crossgen.exe | |
popd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Runtime.CompilerServices; | |
using Internal.Runtime.Augments; | |
class Program | |
{ | |
static void Fill(ConditionalWeakTable<object,object> cwt) | |
{ | |
Object[] o = new object[1000000]; | |
for (int i = 0; i < o.Length; i++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading.Tasks; | |
using System.Diagnostics; | |
using System.Runtime.InteropServices; | |
using System.Threading; | |
// Taking this lock on the same thread repeatedly is very fast because of it has no interlocked operations. | |
// Switching the thread where the lock is taken is expensive because of allocation and FlushProcessWriteBuffers. | |
class AsymmetricLock | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
struct MyG<T,U> : IEquatable<MyG<T,U>> | |
{ | |
static bool visited; | |
public static void foo(int depth) | |
{ | |
if (visited) return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class MyG<T,U> | |
{ | |
static Lazy<MyG<T,U>> s_lazy = new Lazy<MyG<T,U>>(); | |
public static void foo(int depth) | |
{ | |
if (s_lazy.IsValueCreated) return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Text; | |
using System.IO; | |
class My { | |
static void Test(string name, string path) | |
{ | |
int start = Environment.TickCount; | |
int count = 200000000 / path.Length; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading; | |
using System.Reflection; | |
using System.Runtime.Loader; | |
class MyALC : AssemblyLoadContext | |
{ | |
protected override Assembly Load(AssemblyName name) | |
{ | |
return null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading; | |
using System.Buffers; | |
class Program | |
{ | |
#if false | |
static byte[] AcquireBuffer() | |
{ | |
return new byte[4096]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
struct MyStruct<A,B> | |
{ | |
public static void foo(int depth) | |
{ | |
MyStruct<A,B>[] a = null; | |
Array.Resize(ref a, 1); | |
if (depth-- == 0) return; | |
MyStruct<MyStruct<A,B>,B>.foo(depth); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Runtime.InteropServices; | |
namespace System.Runtime.InteropServices | |
{ | |
[AttributeUsage(AttributeTargets.Method)] | |
public sealed class NativeCallableAttribute : Attribute | |
{ | |
public string EntryPoint; | |
public CallingConvention CallingConvention; |