1#ifndef _RHEOLEF_STACK_ALLOCATOR_H
2#define _RHEOLEF_STACK_ALLOCATOR_H
28#include "rheolef/compiler.h"
29#include "rheolef/pretty_name.h"
120 new(
reinterpret_cast<void*
>(
p) )
T(c);
135 trace_macro (
"allocate "<<n<<
" type " << typename_macro(
T));
142 throw std::bad_alloc();
148 trace_macro (
"deallocate "<<n<<
" type "<<typename_macro(
T));
170 trace_macro (
"stack_allocator::mem_info cstor NULL");
192template <
typename T1>
197template <
typename T1>
200 return lhs.get_handler() != rhs.get_handler();
const handler_type * get_handler() const
stack_allocator(unsigned char *stack, size_t stack_size)
pointer allocate(size_type n, const void *=NULL)
pointer address(reference r) const
void construct(pointer p, const_reference c)
stack_allocator & operator=(const stack_allocator &sa)
void construct(pointer p)
size_type max_size() const
stack_allocator(const stack_allocator &sa)
std::ptrdiff_t difference_type
void deallocate(pointer p, size_type n)
const_pointer address(const_reference c) const
stack_allocator(const stack_allocator< U > &sa)
const T & const_reference
#define trace_macro(message)
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
This file is part of Rheolef.
bool operator!=(const heap_allocator< T1 > &lhs, const heap_allocator< T1 > &rhs)
bool operator==(const heap_allocator< T1 > &lhs, const heap_allocator< T1 > &rhs)
handler_type(unsigned char *stack1, size_t size1)
stack_allocator< U > other