Module raii_tracking

Module raii_tracking 

Source
Expand description

RAII Tracking Module

This module implements advanced RAII (Resource Acquisition Is Initialization) tracking:

  • Phase 1: Reference/pointer stored in container outliving pointee
  • Phase 2: User-defined RAII types (classes with destructors)
  • Phase 3: Iterator outlives container
  • Phase 4: Lambda escape analysis (refined)
  • Phase 5: Member lifetime tracking
  • Phase 6: new/delete tracking
  • Phase 7: Constructor initialization order

Structs§

ContainerBorrow
Track pointers/references stored in containers When a pointer is stored in a container, the pointee must outlive the container
HeapAllocation
Track heap allocations
IteratorBorrow
Track iterator borrows from containers
LambdaCapture
Track lambda captures and their escape potential
MemberBorrow
Track references to object members (Phase 5) When &obj.field is taken, the reference has the same lifetime as obj
RaiiTracker
Main RAII tracker that coordinates all RAII-related tracking

Enums§

AllocationState
Track new/delete operations for double-free and use-after-free detection

Functions§

check_raii_issues
Check for RAII-related issues in a function
has_user_defined_destructor
Check if a type has a user-defined destructor This is used for Phase 2: User-defined RAII types