~/talk

Manual Memory Management in .NET Framework

Talkat DevConf 2019 · 2019-09-25..09-27· [dotnet, security]
slides:none on file

Shows how to copy and allocate reference objects anywhere by using TypedReference and __makeref/__refto, then getting raw pointers to object headers and fields to place an object on the stack or inside a custom allocator. Demonstrates patching the CLR allocation routine (bump-pointer) to hijack new so new objects land in a user allocator, builds an unsafe packed list that cuts insertion time from ~8–18s to under 3s, and hides trees from the GC to drop collection from ~30s to a few ms using WinDbg+SOS and emitted IL/dynamic methods.

AI-written summary · about

  1. 0:00Introduction to talk
  2. 1:55Understanding object memory structure
  3. 9:04Demo 1: Allocating objects on stack
  4. 24:04Demo 2: Implementing unsafe list
  5. 30:27Demo 3: Custom memory allocator
  6. 33:56Hijacking operator new in .NET
  7. 42:22Demo 4: Improving GC performance
  8. 45:57Q&A and wrap-up
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.