C++ SDK Documentation  12.0.3
Vertica::VTAllocGuard Struct Reference

tracks a block of memory allocated via VTAllocator to ensure it is freed when this object is destructed. More...

Collaboration diagram for Vertica::VTAllocGuard:
Collaboration graph

Public Member Functions

 VTAllocGuard (VTAllocator *alloc, size_t sz)
 
 VTAllocGuard (const VTAllocGuard &copy)=delete
 
 VTAllocGuard (VTAllocGuard &&movefrom)
 
char * operator* () const
 

Public Attributes

VTAllocator *const alloc
 
char * ptr
 
const size_t sz
 

Detailed Description

tracks a block of memory allocated via VTAllocator to ensure it is freed when this object is destructed.

The same VTAllocator object is used to allocate and free, so this must out-live that VTAllocator.