WPILibC++ 2024.1.1-beta-4
wpi::DebugEpochBase Class Reference

A base class for data structure classes wishing to make iterators ("handles") pointing into themselves fail-fast. More...

#include </home/runner/work/allwpilib/allwpilib/wpiutil/src/main/native/thirdparty/llvm/include/wpi/EpochTracker.h>

Inheritance diagram for wpi::DebugEpochBase:
wpi::DenseMapBase< DenseMap< KeyT, ValueT, DenseMapInfo< KeyT >, wpi::detail::DenseMapPair< KeyT, ValueT > >, KeyT, ValueT, DenseMapInfo< KeyT >, wpi::detail::DenseMapPair< KeyT, ValueT > > wpi::DenseMapBase< SmallDenseMap< KeyT, ValueT, 4, DenseMapInfo< KeyT >, wpi::detail::DenseMapPair< KeyT, ValueT > >, KeyT, ValueT, DenseMapInfo< KeyT >, wpi::detail::DenseMapPair< KeyT, ValueT > > wpi::DenseMapBase< SmallDenseMap< KeyT, unsigned, InlineBuckets, DenseMapInfo< KeyT >, wpi::detail::DenseMapPair< KeyT, unsigned > >, KeyT, unsigned, DenseMapInfo< KeyT >, wpi::detail::DenseMapPair< KeyT, unsigned > > wpi::DenseMapBase< DenseMap< KeyT, unsigned, DenseMapInfo< KeyT >, wpi::detail::DenseMapPair< KeyT, unsigned > >, KeyT, unsigned, DenseMapInfo< KeyT >, wpi::detail::DenseMapPair< KeyT, unsigned > > wpi::DenseMapBase< DenseMap< int, EntryInfo2, DenseMapInfo< int >, wpi::detail::DenseMapPair< int, EntryInfo2 > >, int, EntryInfo2, DenseMapInfo< int >, wpi::detail::DenseMapPair< int, EntryInfo2 > > wpi::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT > wpi::SmallPtrSetImplBase wpi::DenseMap< KeyT, ValueT, KeyInfoT, BucketT > wpi::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT > wpi::SmallDenseMap< KeyT, unsigned, N > wpi::DenseMap< KeyT, unsigned > wpi::DenseMap< int, EntryInfo2 > wpi::SmallPtrSetImpl< PointeeType * > wpi::SmallPtrSetImpl< PtrType > wpi::SmallPtrSet< PointeeType *, N > wpi::SmallPtrSet< PtrType, SmallSize > wpi::SmallSet< PointeeType *, N >

Classes

class  HandleBase
 A base class for iterator classes ("handles") that wish to poll for iterator invalidating modifications in the underlying data structure. More...
 

Public Member Functions

 DebugEpochBase ()=default
 
void incrementEpoch ()
 Calling incrementEpoch invalidates all handles pointing into the calling instance. More...
 
 ~DebugEpochBase ()
 The destructor calls incrementEpoch to make use-after-free bugs more likely to crash deterministically. More...
 

Detailed Description

A base class for data structure classes wishing to make iterators ("handles") pointing into themselves fail-fast.

When building without asserts, this class is empty and does nothing.

DebugEpochBase does not by itself track handles pointing into itself. The expectation is that routines touching the handles will poll on isHandleInSync at appropriate points to assert that the handle they're using is still valid.

Constructor & Destructor Documentation

◆ DebugEpochBase()

wpi::DebugEpochBase::DebugEpochBase ( )
default

◆ ~DebugEpochBase()

wpi::DebugEpochBase::~DebugEpochBase ( )
inline

The destructor calls incrementEpoch to make use-after-free bugs more likely to crash deterministically.

Member Function Documentation

◆ incrementEpoch()

void wpi::DebugEpochBase::incrementEpoch ( )
inline

Calling incrementEpoch invalidates all handles pointing into the calling instance.


The documentation for this class was generated from the following file: