ROSE 0.11.145.192
Public Member Functions | List of all members
Sawyer::DefaultAllocator Class Reference

Description

Default allocator.

This is the default allocator used by all Sawyer container classes. It simply delegates to the normal C++ global new and delete allocator.

Definition at line 20 of file DefaultAllocator.h.

#include <Sawyer/DefaultAllocator.h>

Public Member Functions

void * allocate (size_t size)
 Allocate memory.
 
void deallocate (void *addr, size_t size)
 Deallocate memory.
 

Member Function Documentation

◆ allocate()

void * Sawyer::DefaultAllocator::allocate ( size_t  size)
inline

Allocate memory.

Allocates a block of suitably aligned memory for an object that is size bytes. The actual block may be slightly larger. The return value is the address of the new block. Allocators may return a null pointer or throw an exception when the request cannot be satisfied.

Definition at line 27 of file DefaultAllocator.h.

◆ deallocate()

void Sawyer::DefaultAllocator::deallocate ( void *  addr,
size_t  size 
)
inline

Deallocate memory.

Deallocates a block of memory that was allocated by the allocate method and which has not been deallocated in the mean time. The addr and size must be the address returned by allocate and the size that was used to request that block.

Definition at line 36 of file DefaultAllocator.h.


The documentation for this class was generated from the following file: