#include <Malloc_T.h>
Inheritance diagram for ACE_Cached_Mem_Pool_Node:


Public Methods | |
| T * | addr (void) |
| Return the address of free memory. More... | |
| ACE_Cached_Mem_Pool_Node< T > * | get_next (void) |
| Get the next ACE_Cached_Mem_Pool_Node in a list. More... | |
| void | set_next (ACE_Cached_Mem_Pool_Node< T > *ptr) |
| Set the next ACE_Cached_Mem_Pool_Node. More... | |
Private Attributes | |
| ACE_Cached_Mem_Pool_Node< T > * | next_ |
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 ACE_Cached_Allocator class but this can't be done due to C++ compiler portability problems.
Definition at line 42 of file Malloc_T.h.
|
||||||||||
|
Return the address of free memory.
Definition at line 7 of file Malloc_T.i.
00008 {
00009 // This should be done using a single reinterpret_cast, but Sun/CC
00010 // (4.2) gets awfully confused when T is a char[20] (and maybe other
00011 // types).
00012 return ACE_static_cast (T *, ACE_static_cast (void *, this));
00013 }
|
|
||||||||||
|
Get the next ACE_Cached_Mem_Pool_Node in a list.
Definition at line 16 of file Malloc_T.i. References next_.
00017 {
00018 return this->next_;
00019 }
|
|
||||||||||
|
Set the next ACE_Cached_Mem_Pool_Node.
Definition at line 22 of file Malloc_T.i. References next_.
00023 {
00024 this->next_ = ptr;
00025 }
|
|
|||||
|
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. Definition at line 62 of file Malloc_T.h. |
1.2.14 written by Dimitri van Heesch,
© 1997-2002