~/talk

Swift's Pointy Bits: Unsafe Swift & Pointer Types

slides:none on file

Covers Swift’s eight unsafe pointer types (typed vs raw, mutable vs immutable) and buffer pointers, shows interop with a C API (SKSearchFindMatches) and two optimizations: replacing a zeroed array with manual UnsafeMutablePointer.allocate plus defer deallocate to skip needless initialization, and using withUnsafeMutableBufferPointer to eliminate per-access bounds checks — both trade safety for measurable speed. Emphasizes strict rules: never escape pointers from withUnsafe... or rely on implicit ampersand conversions, and explains bind vs assumingBound semantics and when behavior becomes undefined.

AI-written summary · about

  1. 0:00Intro
  2. 0:12Swift's Pointy Bits
  3. 4:07Unexpected Behavior
  4. 7:45Unsafe Pointer Types
  5. 11:00Mutable
  6. 19:59Really Not Safe at All
~/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.