Shaka Player Embedded
|
#include <heap_tracer.h>
Public Member Functions | |
HeapTracer () | |
~HeapTracer () | |
const std::unordered_set< const Traceable * > & | alive () const |
void | ForceAlive (const Traceable *ptr) |
void | Trace (const Traceable *ptr) |
template<typename T > | |
void | Trace (const std::vector< T > *array) |
template<typename T > | |
void | Trace (const std::list< T > *array) |
template<typename Key , typename Value > | |
void | Trace (const std::unordered_map< Key, Value > *map) |
template<typename T > | |
void | Trace (const optional< T > *opt) |
template<typename... Types> | |
void | Trace (const variant< Types... > *variant) |
void | Trace (const std::string *) |
void | Trace (const bool *) |
template<typename T , typename = util::enable_if_t<util::is_number<T>::value || std::is_enum<T>::value>> | |
void | Trace (const T *) |
void | BeginPass () |
void | TraceAll (const std::unordered_set< const Traceable *> &ref_alive) |
void | ResetState () |
This is used to trace our heap to mark objects as alive and tell the JavaScript engine of references we hold.
Definition at line 85 of file heap_tracer.h.
shaka::memory::HeapTracer::HeapTracer | ( | ) |
Definition at line 35 of file heap_tracer.cc.
shaka::memory::HeapTracer::~HeapTracer | ( | ) |
Definition at line 36 of file heap_tracer.cc.
|
inline |
Definition at line 91 of file heap_tracer.h.
void shaka::memory::HeapTracer::BeginPass | ( | ) |
Begins a new GC pass.
Definition at line 48 of file heap_tracer.cc.
void shaka::memory::HeapTracer::ForceAlive | ( | const Traceable * | ptr | ) |
Forces the given pointer to be marked as alive for the current GC run. This ensures that when assigning to a Member<T> field in the middle of a GC run, the object will not be lost.
Definition at line 38 of file heap_tracer.cc.
void shaka::memory::HeapTracer::ResetState | ( | ) |
Resets the stored state.
Definition at line 86 of file heap_tracer.cc.
void shaka::memory::HeapTracer::Trace | ( | const Traceable * | ptr | ) |
Called from the Traceable::Trace method. This marks the given member as alive and recursively marks child objects as alive.
Definition at line 43 of file heap_tracer.cc.
|
inline |
Definition at line 109 of file heap_tracer.h.
|
inline |
Definition at line 115 of file heap_tracer.h.
|
inline |
Definition at line 121 of file heap_tracer.h.
|
inline |
Definition at line 128 of file heap_tracer.h.
|
inline |
Definition at line 133 of file heap_tracer.h.
|
inline |
Definition at line 140 of file heap_tracer.h.
|
inline |
Definition at line 141 of file heap_tracer.h.
|
inline |
Definition at line 145 of file heap_tracer.h.
void shaka::memory::HeapTracer::TraceAll | ( | const std::unordered_set< const Traceable *> & | ref_alive | ) |
Traces the given objects, including all pending objects and all recursive children. This MUST be called at least once each GC pass.
Definition at line 52 of file heap_tracer.cc.