cds  1.3.0
cds::memory::michael::opt::check_bounds< Type > Struct Template Reference

Option setter for bounds checking. More...

#include <cds/memory/michael/options.h>

Detailed Description

template<typename Type>
struct cds::memory::michael::opt::check_bounds< Type >

Option setter for bounds checking.

This option defines a strategy to check upper memory boundary of allocated blocks. Type defines a class for bound checking with following interface:

class bound_checker
{
public:
enum {
trailer_size = numeric_const
};
void make_trailer( void * pStartArea, void * pEndBlock, size_t nAllocSize ) ;
bool check_bounds( void * pStartArea, void * pEndBlock, size_t nBlockSize ) ;
}

Before allocating a memory block of size N, the heap adds the trailer_size to N and really it allocates N + trailer_size bytes. Then, the heap calls make_trailer function of bound checker with arguments:

Before the memory block previously allocated is deallocating, the check_bounds function is called. The function has similar signature:

The function can:

The library provides the following predefined bound checkers, i.e they are possible values of Type template argument:


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

cds 1.3.0 Developed by Maxim Khiszinsky aka khizmax 2007 - 2012
Autogenerated Sat Dec 29 2012 19:12:37 by Doxygen 1.8.3