Session

Manual memory management in .NET Framework

Value types are on a stack and reference types are on a heap - this is a typical answer when one is asked about placement of values in memory. However, is it really defined that way in the .NET Framework specification? Or can we bend the rules and manage memory differently?

During the session I will show how to allocate memory directly by hand using TypedReferences. We will see that it is possible to allocate reference type on a stack, how to implement generic List faster than the default implementation provided by .NET Framework, how to implement custom memory allocator (with any fragmentation strategy we like), and finally, how to hack new keyword provided by the platform to use different allocator. We will examine memory dumps with WinDBG, emit IL code dynamically, and generate machine code for x86 directly in runtime.

Level 400, moderately intense session.

Adam Furmanek

Software Developer, Blogger, Public Speaker, Book Writer

Kraków, Poland

Actions

Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.

Jump to top