Купил сегодня книгу по управлению памятью в Delphi. Понравилось содержание, хочу углубить свои знания в этом вопросе.
А вот и содержание на английском…
Table of Contents:
Introduction
Clean Code
Part 1. Memory management basics and terminology
* Short overview of memory management models
* How memory works
123 + Overview+ Initialization and instantiation+ The stack, the heap, and the differences between them
* Variables and types
12 + Value types, pointers and references, unmanaged and managed types+ Automatic initialization of variables
* Invalid pointers or references – wild, dangling, stale
* Scope and lifetime
* Classes
* Resource management – RAII
Part 2. Object instances
* To be, or not to be
1234 + Nil - The Billion Dollar Mistake+ Passing nil, returning nil+ Nil (Null) Object Pattern+ Nullable types
* Ownership
* Object Instance Lifecycle
12345 + Lifecycle diagram+ Difference in object instance lifecycle between classic and ARC compiler+ Exceptions and exception handling in lifecycle methods+ Creating and destroying an object instance+ Overview of object lifecycle methods
* Lifecycle Coding Patterns
12345678910 + Constructors and destructors+ `AfterConstruction` and `BeforeDestruction`+ Adding the `override` directive+ Calling the `inherited`+ Class constructors and destructors+ Object construction through metaclasses+ Object factories+ Object factory with metaclass+ OnCreate, OnDestroy and similar patterns+ Deep copy - `Assign` method
Part 3. Manual memory management
* Releasing object instances
12345678910 + Methods for releasing object instances- Destroy- Free- FreeAndNil+ Releasing through ownership models- Collections with ownership- Handling exceptions during ownership transfer- TComponent ownership- TComponent notification system
Part 4. ARC memory management
* Automatic Reference Counting – Overview
1234 + Golden Rule of ARC+ Strong & weak references - [weak], [unsafe], pointer+ Ownership+ Strong reference cycles
* Automatic Reference Counting in Delphi
12 + ARC in classic compiler - Interfaces+ Delphi NextGen ARC compiler
* Automatic Reference Counting – Concepts
1234 + How the reference counting mechanism works+ Reference counting triggers+ Forming of a reference cycle+ When is it safe to use `[unsafe]`?
* DisposeOf – ARC with a twist
123456 + `DisposeOf` in the context of ARC memory management+ `DisposeOf` and object instance lifecycle+ `Disposed` property+ Why does DisposeOf exist in Delphi ARC compilers?+ TComponent notification system and ARC+ Pitfalls of DisposeOf
* Interfaces in the classic compiler
123456 + Mixing object and interface references+ Disabling reference counting+ Chameleon class+ Memory leak on `const` parameter+ Creating a fake interface+ Interface list
* Storing weak and unsafe references in collections
* Anonymous methods
Part 5. Coding patterns
* Smart Pointers
* Lazy
* Weak
Appendix
* References
* Quality Portal Reports