Resource Management Layer 1: Language Mechanics Core Question What ownership pattern does this resource need? Before choosing a smart pointer, understand: - Is ownership single or shared? - Is access single-threaded or multi-threaded? - Are there potential cycles? --- Error → Design Question | Error | Don't Just Say | Ask Instead | |-------|----------------|-------------| | "Need heap allocation" | "Use Box" | Why can't this be on stack? | | Rc memory leak | "Use Weak" | Is the cycle necessary in design? | | RefCell panic | "Use try borrow" | Is runtime check the right approach? | | Arc overh…