Loading...
Searching...
No Matches
TfMallocTag::StackOverride Class Reference

Scoped (i.e. More...

#include <mallocTag.h>

Public Member Functions

 StackOverride (StackState state)
 
 StackOverride (const StackOverride &)=delete
 
StackOverrideoperator= (const StackOverride &)=delete
 

Friends

class TfMallocTag
 

Detailed Description

Scoped (i.e.

local) object for temporarily replacing the current thread's tag stack with a different StackState.

This is typically used to bridge tag stacks in parallelism contexts. For example, a call site that spawns parallel tasks may capture its own tag stack state and pass it to the parallel tasks, that then use a StackOverride to ensure that memory allocations are billed to the same tags as the spawning thread. When StackOverride object is destroyed, the thread's previous tag stack is restored.

Definition at line 362 of file mallocTag.h.

Constructor & Destructor Documentation

◆ StackOverride()

StackOverride ( StackState state)
inlineexplicit

Definition at line 364 of file mallocTag.h.

◆ ~StackOverride()

~StackOverride ( )
inline

Definition at line 372 of file mallocTag.h.

Friends And Related Symbol Documentation

◆ TfMallocTag

friend class TfMallocTag
friend

Definition at line 385 of file mallocTag.h.


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