- 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
推薦閱讀
- Python數據挖掘:入門、進階與實用案例分析
- Mastering Ninject for Dependency Injection
- 計算機信息技術基礎實驗與習題
- Visual Studio 2015 Cookbook(Second Edition)
- Voice Application Development for Android
- Redis應用實例
- 業務數據分析:五招破解業務難題
- 大數據導論
- Access 2016數據庫技術及應用
- 大話Oracle Grid:云時代的RAC
- 軟件成本度量國家標準實施指南:理論、方法與實踐
- MySQL 8.x從入門到精通(視頻教學版)
- “互聯網+”時代立體化計算機組
- MySQL DBA修煉之道
- 區塊鏈+:落地場景與應用實戰