Vertica::VTAllocGuard Struct Reference

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

Collaboration diagram for Vertica::VTAllocGuard:

Public Member Functions
VTAllocGuard (VTAllocator *alloc, size_t sz)
VTAllocGuard (const VTAllocGuard ©)=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.