- Hands-On Design Patterns with Swift
- Florent Vilmart Giordano Scalzo Sergio De Simone
- 135字
- 2021-07-02 14:45:02
Understanding ARC and Memory Management
Swift has a very particular and almost unique memory management strategy: Automatic Reference Counting (ARC). When using ARC, the compiler will inject memory management code for us, but it's very easy to write poor, leaky code, either on purpose or by accident. In this chapter, we'll cover all of the basics for good memory management in Swift. From its origins in Objective-C, to the pre-ARC era, to today, we'll look at how to properly manage our memory and object life cycles. We'll also explore the powerful tools available with Xcode to track memory usage, leaks, cycles, and other defects, through the inspector and the leaks instrument.
In this chapter, we'll cover the following topics:
- A brief history of reference counting
- What is ARC?
- Debugging memory
- Leaks, cycles, and dangling references
推薦閱讀
- 數據庫基礎教程(SQL Server平臺)
- Google Visualization API Essentials
- Python數據分析入門:從數據獲取到可視化
- 信息系統與數據科學
- 虛擬化與云計算
- Libgdx Cross/platform Game Development Cookbook
- Learning JavaScriptMVC
- R數據科學實戰:工具詳解與案例分析(鮮讀版)
- 大數據:規劃、實施、運維
- 數據庫系統原理及應用教程(第4版)
- 深入淺出MySQL:數據庫開發、優化與管理維護(第2版)
- Ceph源碼分析
- 大話Oracle Grid:云時代的RAC
- Sybase數據庫在UNIX、Windows上的實施和管理
- Hands-On Mathematics for Deep Learning