Public Member Functions | Data Fields

HdrHeap::HeapGuard Struct Reference

Struct to prevent garbage collection on heaps. More...

#include <HdrHeap.h>

Collaboration diagram for HdrHeap::HeapGuard:
Collaboration graph
[legend]

Public Member Functions

 HeapGuard (HdrHeap *heap, const char *str)
 Construct the protection.

Data Fields

Ptr< RefCountObjm_ptr
 The heap we protect (if any).

Detailed Description

Struct to prevent garbage collection on heaps.

This bumps the reference count to the heap containing the pointer while the instance of this class exists. When it goes out of scope the reference is dropped. This is useful inside a method or block to keep the required heap data around until leaving the scope.

Definition at line 277 of file HdrHeap.h.


Constructor & Destructor Documentation

HdrHeap::HeapGuard::HeapGuard ( HdrHeap heap,
const char *  str 
) [inline]

Construct the protection.

Definition at line 279 of file HdrHeap.h.

References StrHeapDesc::contains(), m_ptr, HdrHeap::m_read_write_heap, StrHeapDesc::m_ref_count_ptr, and HdrHeap::m_ronly_heap.


Field Documentation

The heap we protect (if any).

Definition at line 297 of file HdrHeap.h.

Referenced by HeapGuard().


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