clan::BlockAllocated Class Reference - ClanLib SDK
Description: clan::BlockAllocated Class Reference

Public Member Functions | List of all members
clan::BlockAllocated Class Reference
clanCore System

Class with operator new/delete overloads for BlockAllocator. More...

`#include <block_allocator.h>`

## Public Member Functions
void | operator delete (void *data, BlockAllocator *allocator)
void | operator delete (void *data, size_t size)
void * | operator new (size_t size, BlockAllocator *allocator)

## Detailed Description

Class with operator new/delete overloads for BlockAllocator.

To use this class, derive your class from BlockAllocated. Then, to allocate your class, use the following operator new syntax:

         BlockAllocator allocator;
         MyObject *obj = new(&allocator) MyObject(..);

Before freeing up the memory using BlockAllocator::free() you have to delete the object first using operator delete. If you fail to do this the destructor will not get called.

## Member Function Documentation

## ◆ operator delete() [1/2]

void clan::BlockAllocated::operator delete | ( | void * | data,
|  | BlockAllocator * | allocator )

## ◆ operator delete() [2/2]

void clan::BlockAllocated::operator delete | ( | void * | data,
|  | size_t | size )

## ◆ operator new()

void * clan::BlockAllocated::operator new | ( | size_t | size,
|  | BlockAllocator * | allocator )

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

- block_allocator.h