官术网_书友最值得收藏!

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
主站蜘蛛池模板: 台州市| 三门峡市| 瑞昌市| 石景山区| 孙吴县| 漠河县| 嘉祥县| 黔东| 刚察县| 荥阳市| 乐平市| 朔州市| 教育| 石渠县| 通城县| 辽阳县| 乌兰县| 马鞍山市| 孝感市| 平谷区| 天全县| 阿鲁科尔沁旗| 呼和浩特市| 池州市| 裕民县| 静海县| 桐城市| 正安县| 巴林左旗| 汕头市| 游戏| 南皮县| 通城县| 黔南| 高清| 陇西县| 应用必备| 沁水县| 右玉县| 锦屏县| 元阳县|