Gecode::Region Class Reference

Handle to region. More...

`#include <region.hpp>`

## Public Member Functions

| Region (void)
| Initialize region.
void | free (void)
| Free allocate memory.

## Construction routines

template<class T>
T & | construct (void)
| Constructs a single object of type T from region using the default constructor.
template<class T, typename A1>
T & | construct (A1 const &a1)
| Constructs a single object of type T from region using a unary constructor.
template<class T, typename A1, typename A2>
T & | construct (A1 const &a1, A2 const &a2)
| Constructs a single object of type T from region using a binary constructor.
template<class T, typename A1, typename A2, typename A3>
T & | construct (A1 const &a1, A2 const &a2, A3 const &a3)
| Constructs a single object of type T from region using a ternary constructor.
template<class T, typename A1, typename A2, typename A3, typename A4>
T & | construct (A1 const &a1, A2 const &a2, A3 const &a3, A4 const &a4)
| Constructs a single object of type T from region using a quaternary constructor.
template<class T, typename A1, typename A2, typename A3, typename A4, typename A5>
T & | construct (A1 const &a1, A2 const &a2, A3 const &a3, A4 const &a4, A5 const &a5)
| Constructs a single object of type T from region using a quinary constructor.
| ~Region (void)
| Return memory.

## Typed allocation routines

template<class T>
T * | alloc (long unsigned int n)
| Allocate block of n objects of type T from region.
template<class T>
T * | alloc (long int n)
| Allocate block of n objects of type T from region.
template<class T>
T * | alloc (unsigned int n)
| Allocate block of n objects of type T from region.
template<class T>
T * | alloc (int n)
| Allocate block of n objects of type T from region.
template<class T>
void | free (T *b, long unsigned int n)
| Delete n objects allocated from the region starting at b.
template<class T>
void | free (T *b, long int n)
| Delete n objects allocated from the region starting at b.
template<class T>
void | free (T *b, unsigned int n)
| Delete n objects allocated from the region starting at b.
template<class T>
void | free (T *b, int n)
| Delete n objects allocated from the region starting at b.
template<class T>
T * | realloc (T *b, long unsigned int n, long unsigned int m)
| Reallocate block of n objects starting at b to m objects of type T from the region.
template<class T>
T * | realloc (T *b, long int n, long int m)
| Reallocate block of n objects starting at b to m objects of type T from the region.
template<class T>
T * | realloc (T *b, unsigned int n, unsigned int m)
| Reallocate block of n objects starting at b to m objects of type T from the region.
template<class T>
T * | realloc (T *b, int n, int m)
| Reallocate block of n objects starting at b to m objects of type T from the region.

## Raw allocation routines

void * | ralloc (size_t s)
| Allocate memory from region.
void | rfree (void *p, size_t s)
| Free memory previously allocated.

## Detailed Description

Handle to region.

Definition at line 55 of file region.hpp.

## Constructor & Destructor Documentation

## Region()

Gecode::Region::Region | ( | void |  | ) |

inline

Initialize region.

Definition at line 352 of file region.hpp.

## ~Region()

Gecode::Region::~Region | ( | void |  | ) |

inline

Return memory.

Definition at line 373 of file region.hpp.

## Member Function Documentation

## free() [1/5]

void Gecode::Region::free | ( | void |  | ) |

inline

Free allocate memory.

Note that in fact not all memory is freed, memory that has been allocated for large allocation requests will not be freed.

Definition at line 356 of file region.hpp.

## alloc() [1/4]

template<class T>

T * Gecode::Region::alloc | ( | long unsigned int | n | ) |

inline

Allocate block of n objects of type T from region.

Note that this function implements C++ semantics: the default constructor of T is run for all n objects.

Definition at line 386 of file region.hpp.

## alloc() [2/4]

template<class T>

T * Gecode::Region::alloc | ( | long int | n | ) |

inline

Allocate block of n objects of type T from region.

Note that this function implements C++ semantics: the default constructor of T is run for all n objects.

Definition at line 394 of file region.hpp.

## alloc() [3/4]

template<class T>

T * Gecode::Region::alloc | ( | unsigned int | n | ) |

inline

Allocate block of n objects of type T from region.

Note that this function implements C++ semantics: the default constructor of T is run for all n objects.

Definition at line 400 of file region.hpp.

## alloc() [4/4]

template<class T>

T * Gecode::Region::alloc | ( | int | n | ) |

inline

Allocate block of n objects of type T from region.

Note that this function implements C++ semantics: the default constructor of T is run for all n objects.

Definition at line 405 of file region.hpp.

## free() [2/5]

template<class T>

void Gecode::Region::free | ( | T * | b,
|  | long unsigned int | n )

inline

Delete n objects allocated from the region starting at b.

Note that this function implements C++ semantics: the destructor of T is run for all n objects.

Note that the memory is not freed, the only effect is running the destructors.

Definition at line 412 of file region.hpp.

## free() [3/5]

template<class T>

void Gecode::Region::free | ( | T * | b,
|  | long int | n )

inline

Delete n objects allocated from the region starting at b.

Note that this function implements C++ semantics: the destructor of T is run for all n objects.

Note that the memory is not freed, the only effect is running the destructors.

Definition at line 419 of file region.hpp.

## free() [4/5]

template<class T>

void Gecode::Region::free | ( | T * | b,
|  | unsigned int | n )

inline

Delete n objects allocated from the region starting at b.

Note that this function implements C++ semantics: the destructor of T is run for all n objects.

Note that the memory is not freed, the only effect is running the destructors.

Definition at line 425 of file region.hpp.

## free() [5/5]

template<class T>

void Gecode::Region::free | ( | T * | b,
|  | int | n )

inline

Delete n objects allocated from the region starting at b.

Note that this function implements C++ semantics: the destructor of T is run for all n objects.

Note that the memory is not freed, the only effect is running the destructors.

Definition at line 430 of file region.hpp.

## realloc() [1/4]

template<class T>

T * Gecode::Region::realloc | ( | T * | b,
|  | long unsigned int | n,
|  | long unsigned int | m )

inline

Reallocate block of n objects starting at b to m objects of type T from the region.

Note that this function implements C++ semantics: the copy constructor of T is run for all objects, the default constructor of T is run for all remaining objects, and the destrucor of T is run for all n objects in b.

Returns the address of the new block.

Definition at line 437 of file region.hpp.

## realloc() [2/4]

template<class T>

T * Gecode::Region::realloc | ( | T * | b,
|  | long int | n,
|  | long int | m )

inline

Reallocate block of n objects starting at b to m objects of type T from the region.

Note that this function implements C++ semantics: the copy constructor of T is run for all objects, the default constructor of T is run for all remaining objects, and the destrucor of T is run for all n objects in b.

Returns the address of the new block.

Definition at line 453 of file region.hpp.

## realloc() [3/4]

template<class T>

T * Gecode::Region::realloc | ( | T * | b,
|  | unsigned int | n,
|  | unsigned int | m )

inline

Reallocate block of n objects starting at b to m objects of type T from the region.

Note that this function implements C++ semantics: the copy constructor of T is run for all objects, the default constructor of T is run for all remaining objects, and the destrucor of T is run for all n objects in b.

Returns the address of the new block.

Definition at line 460 of file region.hpp.

## realloc() [4/4]

template<class T>

T * Gecode::Region::realloc | ( | T * | b,
|  | int | n,
|  | int | m )

inline

Reallocate block of n objects starting at b to m objects of type T from the region.

Note that this function implements C++ semantics: the copy constructor of T is run for all objects, the default constructor of T is run for all remaining objects, and the destrucor of T is run for all n objects in b.

Returns the address of the new block.

Definition at line 466 of file region.hpp.

## ralloc()

void * Gecode::Region::ralloc | ( | size_t | s | ) |

inline

Allocate memory from region.

Definition at line 361 of file region.hpp.

## rfree()

void Gecode::Region::rfree | ( | void * | p,
|  | size_t | s )

inline

Free memory previously allocated.

Note that the memory is only guaranteed to be freed after the region object itself gets deleted.

Definition at line 370 of file region.hpp.

## construct() [1/6]

template<class T>

T & Gecode::Region::construct | ( | void |  | ) |

inline

Constructs a single object of type T from region using the default constructor.

Definition at line 478 of file region.hpp.

## construct() [2/6]

template<class T, typename A1>

T & Gecode::Region::construct | ( | A1 const & | a1 | ) |

inline

Constructs a single object of type T from region using a unary constructor.

The parameter is passed as a const reference.

Definition at line 483 of file region.hpp.

## construct() [3/6]

template<class T, typename A1, typename A2>

T & Gecode::Region::construct | ( | A1 const & | a1,
|  | A2 const & | a2 )

inline

Constructs a single object of type T from region using a binary constructor.

The parameters are passed as const references.

Definition at line 490 of file region.hpp.

## construct() [4/6]

template<class T, typename A1, typename A2, typename A3>

T & Gecode::Region::construct | ( | A1 const & | a1,
|  | A2 const & | a2,
|  | A3 const & | a3 )

inline

Constructs a single object of type T from region using a ternary constructor.

The parameters are passed as const references.

Definition at line 497 of file region.hpp.

## construct() [5/6]

template<class T, typename A1, typename A2, typename A3, typename A4>

T & Gecode::Region::construct | ( | A1 const & | a1,
|  | A2 const & | a2,
|  | A3 const & | a3,
|  | A4 const & | a4 )

inline

Constructs a single object of type T from region using a quaternary constructor.

The parameters are passed as const references.

Definition at line 504 of file region.hpp.

## construct() [6/6]

template<class T, typename A1, typename A2, typename A3, typename A4, typename A5>

T & Gecode::Region::construct | ( | A1 const & | a1,
|  | A2 const & | a2,
|  | A3 const & | a3,
|  | A4 const & | a4,
|  | A5 const & | a5 )

inline

Constructs a single object of type T from region using a quinary constructor.

The parameters are passed as const references.

Definition at line 511 of file region.hpp.

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

- gecode/kernel/memory/region.hpp
- gecode/kernel/memory/region.cpp