Thread portable class


Gate portable class


Timer class


Pool class


Terimber 2.0


About C++


Downloads Products & Services Support Clients Open Source About



Home / Open source / Terimber 2.0

rep_allocator Class Reference

class support "deallocation" actually memory reusing More...

#include <memory.h>

Inheritance diagram for rep_allocator:

byte_allocator array_allocator< T > node_allocator< T > node_allocator< TYPENAME base_list< msg_cpp * >::_node >

List of all members.

Public Member Functions

void clear_all (bool secure=false)
 clears all chunks
void clear_extra (bool secure=false)
 clears extra chunks
void reset (bool secure=false)
 resets allocator for memory reusing
void deallocate (void *p)
 pushes pointer to object back to repository stack

Protected Member Functions

 rep_allocator (size_t capacity=os_def_size)
 constructor
 ~rep_allocator ()
 destructor

Protected Attributes

chunk_stack _rep
 repository stack of chunks

Private Member Functions

 rep_allocator (const rep_allocator &x)
 private copy constructor
rep_allocator operator= (const rep_allocator &x)
 private assign operator


Detailed Description

class support "deallocation" actually memory reusing

Definition at line 158 of file memory.h.


Constructor & Destructor Documentation

rep_allocator::rep_allocator ( const rep_allocator x  )  [private]

private copy constructor

rep_allocator::rep_allocator ( size_t  capacity = os_def_size  )  [protected]

constructor

Parameters:
capacity  default capacity

Definition at line 141 of file memory.cpp.

rep_allocator::~rep_allocator (  )  [protected]

destructor

Definition at line 146 of file memory.cpp.

References _rep, and chunk_stack::clear().


Member Function Documentation

rep_allocator rep_allocator::operator= ( const rep_allocator x  )  [private]

private assign operator

void rep_allocator::clear_all ( bool  secure = false  )  [inline]

clears all chunks

Parameters:
secure  rewrite memory before release

Reimplemented from byte_allocator.

Definition at line 161 of file memory.hpp.

References _rep, chunk_stack::clear(), and byte_allocator::clear_all().

Referenced by varmap< T, C >::clear(), stack< T >::clear(), map< K, T, Pr, M >::clear(), list< T >::clear(), and aiogate::off().

void rep_allocator::clear_extra ( bool  secure = false  )  [inline]

clears extra chunks

Parameters:
secure  rewrite memory before release

Reimplemented from byte_allocator.

Definition at line 153 of file memory.hpp.

References _rep, chunk_stack::clear(), and byte_allocator::clear_extra().

Referenced by xml_document::container_reset(), aiosock::off(), and aiofile::off().

void rep_allocator::reset ( bool  secure = false  )  [inline]

resets allocator for memory reusing

Parameters:
secure  rewrite memory before release

Reimplemented from byte_allocator.

Definition at line 169 of file memory.hpp.

References _rep, chunk_stack::clear(), and byte_allocator::reset().

Referenced by array_allocator_creator< T >::back(), node_allocator_creator< T >::back(), var_object_repository::reset(), and variant_factory::reset().

void rep_allocator::deallocate ( void *  p  )  [inline]

pushes pointer to object back to repository stack

Parameters:
p  pointer to memory

Reimplemented from byte_allocator.

Definition at line 178 of file memory.hpp.

References _rep, and chunk_stack::push().

Referenced by stack< T >::_freenode(), map< K, T, Pr, M >::_freenode(), list< T >::_freenode(), aiosock::_put_block(), aiofile::_put_block(), _vector< T, A >::clear(), variant_factory::destroy(), aiogate::final_close(), aiogate::recv(), and aiogate::v_on_send().


Member Data Documentation


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


© Copyright Terimber 2003-.