Skip to content

Instantly share code, notes, and snippets.

@jkotas
Created July 27, 2017 17:45
Show Gist options
  • Save jkotas/6c92c0e432fa54a16a1a96f5e4528122 to your computer and use it in GitHub Desktop.
Save jkotas/6c92c0e432fa54a16a1a96f5e4528122 to your computer and use it in GitHub Desktop.
String::.ctor(ReadOnlySpan<char> span)
// csc /noconfig /nostdlib /r:System.Private.CoreLib.dll test.cs
using System;
using Internal.Runtime.Augments;
class My {
static void Work() {
for (;;) GC.Collect();
}
static object[] a = new object[1000];
static void Main() {
RuntimeThread.Create(Work).Start();
var r = new Random();
var s = new ReadOnlySpan<char>("Hello".ToCharArray());
for (;;) {
a[r.Next(a.Length)] = new String(s);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment