![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cHeap.h>
Public Member Functions | |
cHeapBlock () noexcept | |
cHeapBlock (const THIS_t &ref) | |
cHeapBlock (THIS_t &&ref) noexcept | |
cHeapBlock (size_t nSize) | |
cHeapBlock (const void *pDataCopy, size_t nSize) | |
~cHeapBlock () | |
THIS_t & | operator= (const THIS_t &ref) |
THIS_t & | operator= (THIS_t &&ref) |
bool | isValidRead () const noexcept |
bool | isCorrupt () const noexcept |
size_t | get_AllocSize () const |
size_t | GetHeapStats (OUT ITERATE_t &iAllocCount) const |
void | Free () |
void | FreeSecure () |
void | SetHeapBlock (void *pData, size_t nSize) |
void | DetachHeapBlock () |
bool | Alloc (size_t nSize) |
bool | Alloc (const void *pData, size_t nSize) |
bool | ReAlloc (size_t nSize) |
bool | ReAlloc (const void *pData, size_t nSize) |
bool | ReAllocLazy (size_t iSizeNew) |
bool | SetCopy (const cHeapBlock &rSrc) |
void * | get_Data () const noexcept |
BYTE * | get_DataBytes () const noexcept |
char * | get_DataA () const noexcept |
wchar_t * | get_DataW () const noexcept |
operator void * () const noexcept | |
operator BYTE * () const noexcept | |
operator char * () const noexcept | |
![]() | |
cMemBlock () noexcept | |
cMemBlock (const void *pData, size_t nSize) noexcept | |
cMemBlock (const cMemBlock &block) noexcept | |
cMemBlock (const cMemBlock *pBlock) noexcept | |
size_t | get_DataSize () const noexcept |
void * | get_Data () const noexcept |
BYTE * | get_DataBytes () const noexcept |
char * | get_DataA () const noexcept |
operator const BYTE * () const noexcept | |
bool | isValidPtr () const noexcept |
bool | IsValidIndex (size_t i) const noexcept |
bool | IsValidIndex2 (size_t i) const noexcept |
bool | IsValidPtr (const void *p) const noexcept |
bool | IsValidPtr2 (const void *p) const noexcept |
bool | IsZeros () const noexcept |
bool | IsEqualData (const void *pData, size_t nSize) const noexcept |
bool | IsEqualData (const cMemBlock *pData) const noexcept |
bool | IsEqualData (const cMemBlock &data) const noexcept |
BYTE * | GetOffset (size_t nOffset) const |
const void * | get_DataEnd () const noexcept |
void | put_DataPtr (void *pStart) noexcept |
void | put_Size (size_t nSize) noexcept |
void | SetBlock (void *pData, size_t nSize) noexcept |
void | SetEmptyBlock () noexcept |
void | InitZeros () noexcept |
StrLen_t | ConvertToString (char *pszDst, StrLen_t iDstSizeMax) const |
Additional Inherited Members | |
![]() | |
static COMPARE_t __stdcall | Compare (const void *pData1, size_t iLen1, const void *pData2, size_t iLen2) |
![]() | |
size_t | m_nSize |
size_t of m_pData in bytes. May be determined at runtime. More... | |
void * | m_pData |
A cMemBlock allocated using cHeap. Actual heap allocated size might be more than cMemBlock m_nSize in linux or Lazy allocations. destruct = call cHeap::FreePtr().
|
inlinenoexcept |
|
inline |
copy constructor
|
inlinenoexcept |
move constructor.
|
inlineexplicit |
Construct with initial size. uninitialized data.
|
inline |
Allocate then Copy pDataCopy data into this.
|
inline |
|
inline |
Allocate then copy something into it.
|
inline |
Allocate a memory block of size. assume m_pData points to uninitialized data.
|
inline |
Someone has copied this buffer.
|
inline |
|
inline |
|
inline |
Special version of get_Size() to measure the true allocation size.
|
inlinenoexcept |
Might be nullptr. that's OK. NOTE: This hides the cMemBlock implimentation so call isCorrupt()
|
inlinenoexcept |
Get as a char pointer.
|
inlinenoexcept |
Get as a BYTE pointer. possibly nullptr.
|
inlinenoexcept |
Get as a wchar_t pointer.
|
inline |
sizeof all children alloc(s). not size of *this
|
inlinenoexcept |
Is this a corrupt heap pointer? nullptr is OK.
|
inlinenoexcept |
Is this valid to use for read? Must NOT be nullptr! Has the memory been corrupted ?
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
copy assignment operator. Allocate a new copy.
|
inline |
|
inline |
If already allocated re-use the current block if possible. copy existing data to new block if move is needed. preserve data.
|
inline |
Do not shrink the buffer size. only grow. but record the size i asked for. A HeapBlock that is faster to reallocate. optimize reallocate to smaller size by leaving the allocation alone. Lazy realloc in the case of shrink.
|
inline |
Copy from h into me.
|
inline |
Dangerous to allow anyone to poke a new pData pointer and nSize into this. We will free pData on destructor!