~/talk

Manual memory management in .NET Framework

Talkat NDC Porto 2019 · 2019-02-26..03-01· [dotnet]
slides:none on file

Demo shows how to allocate and manipulate reference instances outside the GC by reading type handles, pulling object size from type metadata, copying or constructing instances into chosen memory, and pinning them; it uses TypedReference/__makeref and refvalue to get pointer-to-pointer indirections, emits IL to call constructors, inspects memory with WinDBG, and implements a custom allocator and an hijack new via machine-code patch so new routes to the allocator. Result: an unsafe contiguous-list insertion is ~3x faster, iteration similar, and objects behave with proper RTTI and syncblock semantics (but can crash).

AI-written summary · about

  1. 0:00Start
  2. 1:16About Me
  3. 1:43Agenda
  4. 2:14Memory Structure
  5. 2:55Where Are Objects Stored in Dope Net
  6. 5:10Internals
  7. 9:41Make Ref
  8. 10:16Ref Value
  9. 11:52Generations in Dotnet Framework
  10. 12:55Demo
  11. 14:00Pointer Magic
  12. 14:35Type Safety
  13. 15:18Launch in Debug Attach to the Process
  14. 31:01Implement a Full-Blown Normal Memory Allocator in Net
~/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.