From 34203aadb89619e33acd4e2536f9be7d565d6876 Mon Sep 17 00:00:00 2001 From: Rodrigo Kumpera Date: Sun, 7 Mar 2010 20:29:00 +0000 Subject: [PATCH] 2010-03-07 Rodrigo Kumpera * Runtime.cs: Document how NewObject() is meant to be used. svn path=/trunk/mcs/; revision=153224 --- mcs/class/corlib/Mono/ChangeLog | 4 ++++ mcs/class/corlib/Mono/Runtime.cs | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/mcs/class/corlib/Mono/ChangeLog b/mcs/class/corlib/Mono/ChangeLog index f2591405d9b..bae12d1f9f0 100644 --- a/mcs/class/corlib/Mono/ChangeLog +++ b/mcs/class/corlib/Mono/ChangeLog @@ -1,3 +1,7 @@ +2010-03-07 Rodrigo Kumpera + + * Runtime.cs: Document how NewObject() is meant to be used. + 2010-03-04 Geoff Norton * Runtime.cs: Add a new private internal icall to construct diff --git a/mcs/class/corlib/Mono/Runtime.cs b/mcs/class/corlib/Mono/Runtime.cs index 87d2b632a79..920c545e6f7 100644 --- a/mcs/class/corlib/Mono/Runtime.cs +++ b/mcs/class/corlib/Mono/Runtime.cs @@ -48,6 +48,16 @@ namespace Mono { [MethodImplAttribute (MethodImplOptions.InternalCall)] internal static extern string GetDisplayName (); + /* + Create a object without calling any of it's constructors. + @h is a pointer to the runtime type handle of that object. + Recomended usage is to emit the following code sequence: + ldtoken [mscorlib]System.Object + call object [mscorlib]Mono.Runtime::NewObject(intptr) + + This is the only well understood sequence known by the JIT + which produces faster code. + */ [MethodImplAttribute (MethodImplOptions.InternalCall)] internal static extern object NewObject (IntPtr h); } -- 2.25.1