How handy auto-boxing could be!

I’ve been quiet for 3 months and probably won’t have much time for blogs for next several months down the road. Today I got a chance to update my post OutOfMemoryException and Pinning to correct a mistake pointed out by our GC architect Patrick Dussud. Also I want to remind everyone that Michael Stanton posted a great article in…

0

Dangerous PInvokes – string modification

Objects in CLR are usually managed by the runtime in GC heap; user code does not have direct access to the objects. CLR’s reliability and type safety heavily rely on this fact. But CLR also support InterOp features like COM InterOp, IJW and PInvoke to allow unmanaged code to touch managed objects directly. It’s very…

5

FCall and GC hole – first post about Rotor

An exsample of FCall My friend Joel Pobar had a great post to demo how to add new code to Rotor which exposes more EE(Execution Engine) internal information to managed world. This is a very good example covers both BCL and EE, and how the two parts interact with each other. As showed in this example, BCL code…

5

ExitThread() in managed program?

I’ve seen people calls OS’s ExitThread in managed applications via PInvoke to exit a managed thread, like this: [DllImport( “Kernel32.dll”)]public static extern void ExitThread(int exitCode); public static void Run (){    …    // calling OS’s ExitThread to exit the current thread    ExitThread (0);} public static void Main () {    ThreadStart threadStart = new ThreadStart(Run);    Thread thread…

3

OutOfMemoryException and Pinning

As you all know, in CLR memory management is done by Garbage collector (GC). When GC can’t find memory in preallocated memory chunk (GC heap) for new objects and can’t book enough memory from the OS to expand GC heap, it throws OutOfMemoryException (OOM).   The problem From time to time, I’ve heard complaints about…

10

Hello world!

Hello, everybody. I’m Yun Jin, a dev works in CLR’s Quick Response Team under Michael Stanton . As Michael mentioned in his blog, our job mostly involves debugging, analyzing and fixing all kinds of weird stress failures in CLR and partner teams. CLR related debugging request from customer is another major issue we deal with. In…

2