A Swift Stack Overflow by マイケル ピートリー

iOSDC Japan 2021
2021/09/17 18:30〜
Track B

A Swift Stack Overflow

kapsy1312 マイケル ピートリー kapsy1312

I will explain stack memory basics using Swift, and highlight some of the pitfalls even experienced programmers may encounter when working with the stack.

Since stack memory is automatically managed, and Swift mostly uses heap allocated objects, most programmers don't require a deep knowledge of stack memory, despite using sites like "Stack Overflow" every day.

Being oblivious to stack memory is usually not a problem, however it is worth learning about, especially if interfacing with C code.

In my talk I will cover the following:

  • What is the stack?
  • Simple example of stack usage in C, with equivalents in Swift
  • Why do we care about the stack in Swift?
  • Examples of bad stack usage in Swift
  • How to debug and avoid stack issues