clr

What are the differences in JIT between Java and .Net

I know Microsoft .NET uses the CLR as a JIT compiler while Java has the Hotspot. What Are the differences between them? ...

What is the header of an array in .NET

Hi all, I have a little bit seen the representation of an array in memory with Windbg and SOS plugin. Here it is the c# : class myobj{ public int[] arr; } class Program{ static void Main(string[] args){ myobj o = new myobj(); o.arr = new int[7]; o.arr[0] = 0xFFFFFF; o.arr[1] = 0xFFFFFF; o.arr[2] = 0xFFFFFF; ...

How can I detect which callback from an unmanaged dll causes a protected memory exception?

I get a protected memory exception, but how can I know which call caused it, and why the callback function has moved? All the calls to unmanaged code are done in the same class as the callback functions, so I suppose that the addresses should not change, or am I totally wrong here? ...

CLR 4.0 inlining policy? (maybe bug with MethodImplOptions.NoInlining)

I've testing some new CLR 4.0 behavior in method inlining (cross-assembly inlining) and found some strage results: Assembly ClassLib.dll: using System.Diagnostics; using System; using System.Reflection; using System.Security; using System.Runtime.CompilerServices; namespace ClassLib { public static class A { static readonly Me...

.NET CLR specifications

Hi all, Where can I find the spec of CLR ? For example, I want to look at how is implemented in memory the object "ThreadStart". Thanks. ...

Does the CLR store small values in 'natural' sized locations?

In Java, a byte or short is stored in the JVM's 'natural' word length, i.e. for the most part, 32-bits. An exception would be an array of bytes, where each byte occupies a byte of memory. Does the CLR do the same thing? If it does do this, in what situations are there exceptions to this? E.g. How much memory does this occupy? struct M...

.NET : System.Threading.ThreadStart Class

Hello, I have questions about System.Threading.ThreadStart Class : where can I find its specifications ( there is praticly nothing in the msdn : http://msdn.microsoft.com/en-us/library/system.threading.threadstart.aspx or in ROTOR : www.dotnet247.com/247reference/system/threading/threadstart/__rotor.aspx) what is its field : protected...

Can a VB.NET .dll assembly be reflected by C#

I assume because the CLR this wouldn't be an issue? ...

C# Dispose() -clarification

When i call object.Dispose(); Will CLR immediately destroy the object from memory or mark the object for removal in it's next cycle?. We are calling GC.SuppressFinalize() immediately after Dispose(),Does it mean ,"Don't collect the object again for dispose,because it is already submitted to displose". Actually which generation is resp...

access managed code ( CLR ) DLL with Delphi 7

How delphi7 access C# .net managed dll ? i'm trying to access some DLL that compiled in c# and they are not those old style DLL. ( i dont have source for those DLL) i did tried to search online but they are confusing. i guess there is some limitation even if get to access it with D7 .. thanks. ...

.NET Object Dump

Hi all, I have a question about the dump of an objet. 0:000> !do 0x012817b8 Name: blabla.Union2 MethodTable: 009231ac EEClass: 00921548 Size: 16(0x10) bytes Fields: MT Field Offset Type VT Attr Value Name 790fd0f0 4000003 4 System.Object 0 instance 00000000 o 7912d7c0 4000004 8...

SQL CLR enabling

I would like to get some opinion on production SQL environement enabling CLR 1) What are the disadvantagies of doing something like this. 2) I also would like to know the adoption of something like this. 3) Anything best practices we need to keep in mind when we implement CLR based SP and Triggers. ...

Exposing a C++ API to C#

So what I have is a C++ API contained within a *.dll and I want to use a C# application to call methods within the API. So far I have created a C++ / CLR project that includes the native C++ API and managed to create a "bridge" class that looks a bit like the following: // ManagedBridge.h #include <CoreAPI.h> using namespace __CORE_API...

Are all languages used within .net Equally performant?

I know the "Sales pitch" answer is yes to this question, but is it technically true. The Common Language Runtime (CLR) is designed as an intermediate language based on Imperative Programming (IP), but this has obvious implications when dealing with Declarative Programming (DP). So how efficient is a language based on a different paradi...

System.Decimal rounds on assignment

can anyone explain why I am getting the following results? Dim badDecimal As Decimal = 54.50327999999999 Dim expectedDecimal As Decimal = CDec("54.50327999999999") badDecimal = 54.50328D, while expectedDecimal = 54.50327999999999D. My understanding is that badDecimal should contain the value of expectedDecimal (the fact that expected...

Not seeing Sync Block in Object Layout

It's my understanding that all .NET object instances begin with an 8 byte 'object header': a synch block (4 byte pointer into a SynchTableEntry table), and a type handle (4 byte pointer into the types method table). I'm not seeing this in VS 2010 RC's (CLR 4.0) debugger memory windows. Here's a simple class that will generate a 16 byte...

Why do UInt16 arrays seem to add faster than int arrays?

It seems that C# is faster at adding two arrays of UInt16[] than it is at adding two arrays of int[]. This makes no sense to me, since I would have assumed the arrays would be word-aligned, and thus int[] would require less work from the CPU, no? I ran the test-code below, and got the following results: Int for 1000 took 9896625613 ...

How do I get Nant to use the 4.0 compiler to target .Net 3.5

Yes I know that sounds a little bit crazy, but I've got .Net 3.5 deployed in the field and I'd like to use the new 4.0 compiler to target it. There are several new syntactic sugar features in the latest versions of Vb.Net and C# which I would like to use, but I am unable (just yet) to force a new version of the .Net framework and CLR on...

Is there a way in .NET to access the bytecode/IL/CLR that is currently running?

Hi. I'd like to have access to the bytecode that is currently running or about to run in order to detect certain instructions and take specific actions (depending the instructions). In short, I'd like to monitor the bytecode in order to add safety control (see EDIT #1 for explanation). Is this possible? I know there are some AOP framew...

When does clr loads an assembly in .net process?

Is it loaded when a class from the assembly referenced? Or When a class which declares the using namespace from the Assembly is loaded? Also having loaded an assembly does it ever unloads the assembly if it is not used for a long time? ...