bi-06 step 01 — Ownership audit
Goal
Read five functions you have already met and account for every lifetime decision. This is a reading exercise, not a writing one.
Tasks
- Pick five functions from
bi-03/bi-04you have already navigated to. - For each, write one sentence naming every ownership decision: who owns what, what may die, what is merely borrowed.
- Classify every pointer you see:
unique_ptr/scoped_refptr/raw_ptr/Member<T>/Persistent<T>/ bareT*/T&. - Find one
base::Unretained. Determine what guarantees the receiver outlives the callback. If you cannot determine it in ten minutes, record that — it is a real finding about the code. - Find one class with
SEQUENCE_CHECKER. Name its sequence and how you know.
Done when
- Five functions annotated
-
One
Unretainedlifetime argument written out (or its difficulty recorded) -
You can state the difference between
raw_ptr<T>andMember<T>and when each is wrong