#include <concrete/arena.hpp>
List of all members.
Detailed Description
Member Enumeration Documentation
- Enumerator:
SizeLimit |
Maximum arena size in bytes.
|
Constructor & Destructor Documentation
Arena |
( |
void * |
data, |
|
|
size_t |
size |
|
) |
| throw () |
Create an arena out of a snapshot. The created Arena instance takes ownership of the data, which must have been allocated so that it can be passed to std::realloc().
- Parameters:
-
data | of the snapshot; will be stolen |
size | of the snapshot in bytes |
Member Function Documentation
void * access |
( |
unsigned int |
address, |
|
|
size_t |
size |
|
) |
| |
Get a pointer to an allocated memory block. The pointer is valid until the next allocate() call.
- Parameters:
-
address | of the memory block within the arena |
size | of the memory block |
- Returns:
- borrowed short-term reference
- Exceptions:
-
Get the active instance of the current thread.
Allocate a block of memory.
- Parameters:
-
- Exceptions:
-
Throw an IntegrityError if a previous non-throwing code path has detected one.
- Exceptions:
-
Extend a memory reference obtained with a preceding access() call (without any allocate() calls in between). This simply verifies the new range.
- Parameters:
-
address | which has been already validated |
size | is old_size + extension_size |
- Exceptions:
-
void free |
( |
unsigned int |
address, |
|
|
void * |
data, |
|
|
size_t |
size |
|
) |
| throw () |
Free a block of memory. The data pointer must have been retrieved with a preceding access() or nonthrowing_access() call (without any allocate() calls in between).
- Parameters:
-
address | of the memory block within the arena |
data | pointer to the memory block |
size | of the memory block |
Get a pointer to an allocated memory block. The pointer is valid until the next allocate() call.
- Parameters:
-
address | of the memory block within the arena |
size | of the memory block |
- Returns:
- borrowed short-term reference or NULL
Extend a memory reference obtained with a preceding nonthrowing_access() call (without any allocate() calls in between). This simply validates the new range.
- Parameters:
-
address | which has been already validated |
size | is old_size + extension_size |
- Returns:
- success
Get direct short-term read-only access to the arena memory.