|
wavelength 1.0.0
|
Movable block of a handle heap, reached through a handle the block points back to. More...
#include <memhandle.h>
Public Member Functions | |
| MemHandle (HandleBlock *pBlock) | |
| Attach the handle to a block with no locks. | |
| void * | Lock () |
| Count a lock and report the data. | |
| void | Unlock () |
| Undo one Lock(). | |
| void * | Resize (int nBytes) |
| Shrink the block in place through MemRealloc(). | |
| HandleBlock * | GetBlock () const |
| void | SetBlock (HandleBlock *pBlock) |
Static Public Member Functions | |
| static void * | operator new (size_t) |
| Allocate a handle from the pool of 4-byte blocks. | |
| static void | operator delete (void *pBlock) |
| Return a handle to the pool of 4-byte blocks. | |
| static MemHandle * | Alloc (int nBytes, const char *pszTag) |
| Allocate a block and a handle for it. | |
| static void | Free (MemHandle *pHandle) |
| Free a handle and its block. | |
Movable block of a handle heap, reached through a handle the block points back to.
The class is not polymorphic. The name is inferred from the allocation tag "MemHandle".
|
explicit |
Attach the handle to a block with no locks.
| pBlock | The block. |
|
inlinestatic |
Allocate a handle from the pool of 4-byte blocks.
|
inlinestatic |
Return a handle to the pool of 4-byte blocks.
| pBlock | The block. |
|
static |
Allocate a block and a handle for it.
The block takes the size rounded up to 16 bytes, with its header.
| nBytes | The bytes of data. |
| pszTag | The allocation tag. |
|
static |
Free a handle and its block.
A null handle is ignored.
| pHandle | The handle. |
| void * MemHandle::Lock | ( | ) |
Count a lock and report the data.
| void MemHandle::Unlock | ( | ) |
| void * MemHandle::Resize | ( | int | nBytes | ) |
Shrink the block in place through MemRealloc().
| nBytes | The bytes of data. |
|
inline |
|
inline |
| pBlock | The block. |