Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_Cached_Mem_Pool_Node Class Template Reference

keeps unused memory within a free list. More...

#include <Malloc_T.h>

Collaboration diagram for ACE_Cached_Mem_Pool_Node:

Collaboration graph
[legend]
List of all members.

Public Methods

T* addr (void)
 return the address of free memory.

ACE_Cached_Mem_Pool_Node<T>* get_next (void)
 get the next ACE_Cached_Mem_Pool_Node in a list.

void set_next (ACE_Cached_Mem_Pool_Node<T> *ptr)
 set the next ACE_Cached_Mem_Pool_Node.


Private Attributes

ACE_Cached_Mem_Pool_Node<T>* next_

Detailed Description

template<class T> template class ACE_Cached_Mem_Pool_Node

keeps unused memory within a free list.

The length of a piece of unused memory must be greater than sizeof (void*). This makes sense because we'll waste even more memory if we keep them in a separate data structure. This class should really be placed within the next class . But this can't be done due to C++ compiler portability problems.


Member Function Documentation

template<classT>
ACE_INLINE T * ACE_Cached_Mem_Pool_Node< T >::addr ( void )
 

return the address of free memory.

template<classT>
ACE_INLINE ACE_Cached_Mem_Pool_Node< T >* ACE_Cached_Mem_Pool_Node< T >::get_next ( void )
 

get the next ACE_Cached_Mem_Pool_Node in a list.

template<classT>
ACE_INLINE void ACE_Cached_Mem_Pool_Node< T >::set_next ( ACE_Cached_Mem_Pool_Node< T >* ptr )
 

set the next ACE_Cached_Mem_Pool_Node.


Member Data Documentation

template<classT>
ACE_Cached_Mem_Pool_Node< T >* ACE_Cached_Mem_Pool_Node<T>::next_ [private]
 

Since memory is not used when placed in a free list, we can use it to maintain the structure of free list. I was using union to hide the fact of overlapping memory usage. However, that cause problem on MSVC. So, I now turn back to hack this with casting.


The documentation for this class was generated from the following files:
Generated at Wed Nov 21 10:29:55 2001 for ACE by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000