Systems Programming · Cluster

Resource Management

Ownership, leaks, and deterministic cleanup.

  1. 01 Release Order at Scope Exit and the LIFO Cleanup Rule Why destructors, defer statements, and scope guards run in reverse order of acquisition, and which ordering guarantees survive partial construction and unwinding. foundational · Jul 11, 2024
  2. 02 Failure Atomicity and Cleanup on the Error Path How partial construction is made safe: commit-or-rollback discipline, errdefer-style compensation, and the invariants a constructor must restore before returning an error. foundational · Nov 30, 2022
  3. 03 Move Semantics and the State Left Behind in the Source What transferring ownership actually changes in memory, why a moved-from object must still be destructible, and how unique ownership differs from a shallow copy. foundational · Mar 21, 2025
  4. 04 Atomic Reference Counts and the Cycle They Cannot Collect The instruction cost of shared ownership, why the count must be atomic, and the reachability problem that makes a pure reference-counting collector leak. intermediate · Jul 24, 2026
  5. 05 Leak Detection by Reachability Rather Than Allocation Count How heap profilers decide that a block is leaked: root sets, conservative scanning, and why a pointer held in a register or a stale stack slot changes the answer. intermediate · Dec 17, 2024
  6. 06 File Descriptor Lifetime, Inheritance, and Table Exhaustion What a descriptor actually indexes, how the process and system tables share file descriptions, and why closing in the wrong process leaves the resource open. intermediate · Jan 11, 2024
  7. 07 Arena Allocation and the Cost of Releasing Everything at Once Bump allocation, region lifetimes, and why destroying a whole arena is cheaper than freeing its objects, together with the reuse patterns that keep it from growing. intermediate · Jun 23, 2025
  8. 08 Finalizers and the Gap Between Reclaimable and Released Why a finalizer runs at an unpredictable time, how resurrection and finalizer ordering break cleanup, and what a disposal protocol adds that collection cannot. advanced · Mar 12, 2025
  9. 09 Cancellation Points and the Half-Finished Cleanup State How asynchronous cancellation, unwinding, and cooperative cancellation interact with cleanup code, and why a cleanup routine must be reentrant against itself. advanced · Nov 11, 2024
  10. 10 Ordered Shutdown, Exit Handlers, and What the Kernel Reclaims Why exit handlers run in reverse order with no error reporting, what survives a call to _exit, and how to drain work before the kernel releases descriptors and mappings. advanced · Dec 8, 2022