Skip to content

Instantly share code, notes, and snippets.

View kumpera's full-sized avatar

Rodrigo Kumpera kumpera

View GitHub Profile
using System;
using System.Reflection;
class Base {
internal void Foo () {}
}
class Child {
internal void Bar () {}
}
using System;
using System.IO;
public enum Foo{
a,b,d
}
class Driver {
static void Main ()
{
public sealed class My3Attribute : Attribute
{
public My3Attribute (object[] arr) {
}
}
[My3 (new Type[] { typeof (DisappearingType) })]
using System;
using System.Threading;
class T
{
static int threads = 4;
static void thread_start()
{
for (int i = 0; i < 200 * 1000 * 1000; ++i) {
using System;
using System.Threading;
using System.Threading.Tasks;
class MainClass {
public static void Main (string [] args)
{
Test ();
}
@kumpera
kumpera / bad_locking.txt
Created March 26, 2015 18:34
Functions that needs locking fixes
Here as the runtime functions that need locking to be adjusted.
There are two categories of locking issues that needs to be addressed:
- Manage allocation while holding a lock
This is bad for performance and is an issue for coop suspend
- Too much stuff done while holding a lock
Locks should only be used to protect data structures. The runtime should
use optimistic initialization everywhere that's possible as it reduces
the surface area of our locking protocol.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Dynamic;
namespace ConsoleTest
{
public class Program
{
diff --git a/mcs/support.cs b/mcs/support.cs
index 433012e..bde81d0 100644
--- a/mcs/support.cs
+++ b/mcs/support.cs
@@ -344,7 +344,7 @@ namespace Mono.CSharp {
class DynamicType : Type
{
public override Assembly Assembly {
- get { return UnderlyingSystemType.Assembly; }
+ get { return CodeGen.Assembly.Builder; }
diff --git a/mono/mini/mini-amd64.c b/mono/mini/mini-amd64.c
index eb9b3ce..b2d1ce8 100644
--- a/mono/mini/mini-amd64.c
+++ b/mono/mini/mini-amd64.c
@@ -1423,6 +1423,14 @@ mono_arch_allocate_vars (MonoCompile *cfg)
/* Allocate locals */
if (!cfg->globalra) {
offsets = mono_allocate_stack_slots_full (cfg, cfg->arch.omit_fp ? FALSE: TRUE, &locals_stack_size, &locals_stack_align);
+ if (locals_stack_size > MONO_ARCH_MAX_FRAME_SIZE) {
+ char *mname = mono_method_full_name (cfg->method, TRUE);
diff --git a/mono/metadata/gc-internal.h b/mono/metadata/gc-internal.h
index f975762..cb8fb5a 100644
--- a/mono/metadata/gc-internal.h
+++ b/mono/metadata/gc-internal.h
@@ -74,6 +74,10 @@ void mono_gc_remove_weak_track_handle (guint32 gchandle) MONO_INTERNAL;
GSList* mono_gc_remove_weak_track_object (MonoDomain *domain, MonoObject *obj) MONO_INTERNAL;
#endif
+/*Ephemeron functionality*/
+void mono_gc_ephemeron_array_add (MonoObject *obj) MONO_INTERNAL;