A simple memory pool, carving out space from a pre-allocated arena
#include <memory_arena.h>
|
CUGAR_HOST_DEVICE | memory_arena (uint8 *_ptr=NULL) |
|
CUGAR_HOST_DEVICE uint8 * | byte_alloc (const uint64 sz, const uint64 alignment=1u) |
|
template<typename T > |
CUGAR_HOST_DEVICE T * | alloc (const uint64 sz, const uint64 alignment=sizeof(T)) |
|
◆ memory_arena()
CUGAR_HOST_DEVICE cugar::memory_arena::memory_arena |
( |
uint8 * |
_ptr = NULL | ) |
|
|
inline |
◆ alloc()
template<typename T >
CUGAR_HOST_DEVICE T* cugar::memory_arena::alloc |
( |
const uint64 |
sz, |
|
|
const uint64 |
alignment = sizeof(T) |
|
) |
| |
|
inline |
typed-allocation
- Parameters
-
sz | the number of items to alloc |
alignment | the requested byte alignment |
◆ byte_alloc()
CUGAR_HOST_DEVICE uint8* cugar::memory_arena::byte_alloc |
( |
const uint64 |
sz, |
|
|
const uint64 |
alignment = 1u |
|
) |
| |
|
inline |
byte-allocation
- Parameters
-
sz | the number of bytes to alloc |
alignment | the requested byte alignment |
The documentation for this struct was generated from the following file:
- C:/p4research/research/jpantaleoni/Fermat-Public/contrib/cugar/basic/memory_arena.h