CXXR (C++ R)
|
Class for implementing R_alloc() and kindred functions. More...
#include <RAllocStack.h>
Classes | |
class | Scope |
Object constraining lifetime of R_alloc() blocks. More... |
Static Public Member Functions | |
static void * | allocate (size_t sz) |
Allocate a new block of memory. | |
static void | restoreSize (size_t new_size) |
Restore stack to a previous size. | |
static size_t | size () |
Current size of stack. |
Friends | |
class | SchwarzCounter< RAllocStack > |
Class for implementing R_alloc() and kindred functions.
This class has only static members. It implements a stack of pointers to blocks of memory.
|
static |
Allocate a new block of memory.
The block will be aligned on a multiple of sizeof(double)
.
sz | The required size in bytes (strictly, as a multiple of sizeof(char) ), of the memory block. |
|
static |
Restore stack to a previous size.
Restore the stack to a previous size by popping elements off the top.
new_size | The size to which the stack is to be restored. Must not be greater than the current size. |
|
inlinestatic |
Current size of stack.