Engineering / core
Lifetimes, allocation, and managed memory
Reason about ownership and object lifetime, then compare runtime allocation and collection mechanisms with explicit safety boundaries.
Your route through engineering
Follow the path or begin with a question. Every lesson is open.
Your place, at your pace. Progress is optional and saved only in this browser when available.
Read / explore / reason
Inside this module
Module 01 core
Lifetimes, allocation, and managed memory
Reason about ownership and object lifetime, then compare runtime allocation and collection mechanisms with explicit safety boundaries.
- 01
Object lifetimes: when an address stops being a resource
Separate allocation, object validity, pointer identity, and retention before deciding when a buffer may be reclaimed.
21 min - 02
Ownership and borrowing: make release responsibility explicit
Use moves, borrows, and explicit copies to design resource lifecycles without confusing a reference with an owner.
22 min - 03
Aliasing and mutability: which writes can affect a read?
Trace overlapping accesses, explain optimization assumptions, and distinguish interior mutability from unrestricted shared mutation.
23 min - 04
Spatial safety: prove the entire access fits
Check offsets, access widths, alignment, and size arithmetic instead of treating a non-null pointer as a valid buffer.
22 min - 05
Reference counting: local release rules and cyclic retention
Trace strong and weak ownership edges, identify cycles, and separate atomic handle management from safe mutation.
23 min - 06
Tracing collection: find the objects reachable from roots
Compute a reachable object graph, compare marking with reclamation, and diagnose retained memory that a collector cannot discard.
23 min - 07
Generational collection: remember edges across the boundary
Explain partial-heap tracing, old-to-young references, remembered sets, and why write barriers preserve collection correctness.
24 min - 08
Compaction and pause budgets: pay for movement deliberately
Relate fragmentation, relocation, pinning, and collection work to a measured latency budget without promising universal pause guarantees.
24 min - 09
Arenas and pools: reuse storage without reusing stale meaning
Compare bulk-lifetime arenas with reusable slots while accounting for alignment, cleanup, retention, and stale handles.
24 min - 10
Foreign-function boundaries: carry ownership across the ABI
Specify layout, allocation pairs, buffer validity, asynchronous retention, and cleanup before presenting a safe native wrapper.
25 min