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

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
主站蜘蛛池模板: 连州市| 白山市| 新竹市| 博湖县| 株洲县| 磴口县| 肇东市| 沂水县| 嘉兴市| 剑河县| 肃南| 黄石市| 扎囊县| 涞水县| 五河县| 钟祥市| 鹿泉市| 海宁市| 荆州市| 东阿县| 盐池县| 固安县| 凌云县| 渭南市| 广汉市| 达州市| 内江市| 上思县| 普宁市| 丹江口市| 黎川县| 大悟县| 固镇县| 塔城市| 湄潭县| 中江县| 江阴市| 武宣县| 余姚市| 泽普县| 浦县|