Matt Warren 10/26/2016

How does the 'fixed' keyword work?

Read Original

This technical article provides a deep dive into the 'fixed' keyword in C#. It explains how 'fixed' enables unsafe code by pinning objects in memory to prevent the garbage collector from moving them. The post details the collaboration between the compiler, JITter, CLR, and Garbage Collector, using code examples and IL inspection to show how 'fixed' works under the hood, including compiler optimizations and the ECMA specification for 'pinned' locals.

How does the 'fixed' keyword work?

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week