~/talk

Ref struct, ref readonly struct, ref returning, ref everything

Talkat .NET Summit 2019 · on Saturday, 2019-06-08· [dotnet, compilers-and-language-design]
slides:none on file

Explains concrete C# features and runtime changes: how ref returns and ref locals avoid copying, how the GC and JIT handle interior pointers, and how C# 7.0–7.3 adds ref ternary, ref foreach and readonly refs that sometimes force defensive copies unless the type is a readonly struct. Shows a working stack-allocated string builder (a ValueStringBuilder) that uses Span<T>, stackalloc and ArrayPool to reduce allocations and improve throughput in hot paths.

AI-written summary · about

  1. 0:00Introduction and motivation
  2. 1:50Class vs struct differences
  3. 5:02Managed pointers and ref parameters
  4. 7:59Ref locals and their use cases
  5. 9:46Ref returning and lifetime rules
  6. 15:54Ref returning in collections
  7. 16:58Ref ternary expressions
  8. 18:04Ref foreach and enumerators
  9. 19:07Read-only ref semantics
  10. 21:39Read-only structs and defensive copies
  11. 27:42Ref struct introduction
  12. 29:51Advantages of ref structs
  13. 30:15Disposable ref structs
  14. 31:22Span and managed pointers
  15. 34:10Summary of ref features
  16. 34:51Value StringBuilder demo
  17. 39:29Q&A session
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.