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

ACE_PI_Control_Block Class Reference

This information is stored in memory allocated by the <Memory_Pool>. More...

#include <PI_Malloc.h>

Collaboration diagram for ACE_PI_Control_Block:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ACE_Based_Pointer<
ACE_Malloc_Header
MALLOC_HEADER_PTR
typedef ACE_Based_Pointer<
ACE_Name_Node
NAME_NODE_PTR
typedef ACE_Based_Pointer_Basic<
char > 
CHAR_PTR

Public Methods

void dump (void) const
 Dump the state of the object. More...


Static Public Methods

void print_alignment_info (void)
 Print out a bunch of size info for debugging. More...


Public Attributes

int ref_counter_
 Reference counter. More...

NAME_NODE_PTR name_head_
 Head of the linked list of Name Nodes. More...

MALLOC_HEADER_PTR freep_
 Current head of the freelist. More...

char lock_name_ [MAXNAMELEN]
 Name of lock thats ensures mutual exclusion. More...

long align_ [ACE_PI_CONTROL_BLOCK_ALIGN_LONGS< 1?1:ACE_PI_CONTROL_BLOCK_ALIGN_LONGS]
 Force alignment. More...

ACE_Malloc_Header base_
 Dummy node used to anchor the freelist. This needs to come last... More...


Private Methods

void operator= (const ACE_Control_Block &)

Detailed Description

This information is stored in memory allocated by the <Memory_Pool>.

This class implements the control block structure that can be used in a "position indepent" fashion, i.e., you don't need to "map" the underlying memory pool to the same address in processes sharing the memory. The tradoff of this flexibility is more expensive malloc/free operations.

Definition at line 42 of file PI_Malloc.h.


Member Typedef Documentation

typedef ACE_Based_Pointer_Basic<char> ACE_PI_Control_Block::CHAR_PTR
 

Definition at line 50 of file PI_Malloc.h.

typedef ACE_Based_Pointer<ACE_Malloc_Header> ACE_PI_Control_Block::MALLOC_HEADER_PTR
 

Definition at line 48 of file PI_Malloc.h.

typedef ACE_Based_Pointer<ACE_Name_Node> ACE_PI_Control_Block::NAME_NODE_PTR
 

Definition at line 49 of file PI_Malloc.h.


Member Function Documentation

void ACE_PI_Control_Block::dump void    const
 

Dump the state of the object.

Definition at line 68 of file PI_Malloc.cpp.

References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_LIB_TEXT, ACE_TRACE, base_, ACE_PI_Control_Block::ACE_Malloc_Header::dump, freep_, LM_DEBUG, name_head_, and ACE_PI_Control_Block::ACE_Malloc_Header::next_block_.

00069 {
00070   ACE_TRACE ("ACE_PI_Control_Block::dump");
00071 
00072   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00073   ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("Name Node:\n")));
00074   for (ACE_Name_Node *nextn = this->name_head_;
00075        nextn != 0;
00076        nextn = nextn->next_)
00077     nextn->dump ();
00078 
00079   ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("freep_ = %x"), (ACE_Malloc_Header *) this->freep_));
00080   this->base_.dump ();
00081 
00082   ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nMalloc Header:\n")));
00083   for (ACE_Malloc_Header *nexth = ((ACE_Malloc_Header *)this->freep_)->next_block_;
00084        nexth != 0 && nexth != &this->base_;
00085        nexth = nexth->next_block_)
00086     nexth->dump ();
00087 
00088   ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\n")));
00089   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00090 }

void ACE_PI_Control_Block::operator= const ACE_Control_Block   [private]
 

void ACE_PI_Control_Block::print_alignment_info void    [static]
 

Print out a bunch of size info for debugging.

Definition at line 34 of file PI_Malloc.cpp.

References ACE_DEBUG, ACE_LIB_TEXT, ACE_MALLOC_ALIGN, ACE_MALLOC_HEADER_SIZE, ACE_MALLOC_PADDING, ACE_PI_CONTROL_BLOCK_ALIGN_LONGS, ACE_PI_CONTROL_BLOCK_SIZE, ACE_PI_MALLOC_PADDING_SIZE, ACE_TRACE, and LM_DEBUG.

00035 {
00036   ACE_TRACE ("ACE_PI_Control_Block::ACE_Control_Block::print_alignment_info");
00037   ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("Start ---> ACE_PI_Control_Block::print_alignment_info:\n")));
00038   ACE_DEBUG ((LM_DEBUG,
00039               ACE_LIB_TEXT ("Sizeof ptr: %d\n")
00040               ACE_LIB_TEXT ("Sizeof size_t: %d\n")
00041               ACE_LIB_TEXT ("Sizeof long: %d\n")
00042               ACE_LIB_TEXT ("Sizeof double: %d\n")
00043               ACE_LIB_TEXT ("Sizeof ACE_MALLOC_ALIGN: %d\n")
00044               ACE_LIB_TEXT ("sizeof ACE_MALLOC_PADDING: %d\n")
00045               ACE_LIB_TEXT ("Sizeof ACE_MALLOC_HEADER_SIZE: %d\n")
00046               ACE_LIB_TEXT ("Sizeof ACE_PI_MALLOC_PADDING_SIZE: %d\n")
00047               ACE_LIB_TEXT ("Sizeof ACE_PI_CONTROL_BLOCK_SIZE: %d\n")
00048               ACE_LIB_TEXT ("Sizeof ACE_PI_CONTROL_BLOCK_ALIGN_LONGS: %d\n")
00049               ACE_LIB_TEXT ("Sizeof (MALLOC_HEADER): %d\n")
00050               ACE_LIB_TEXT ("Sizeof (CONTROL_BLOCK): %d\n"),
00051               sizeof (char *),
00052               sizeof (size_t),
00053               sizeof (long),
00054               sizeof (double),
00055               ACE_MALLOC_ALIGN,
00056               ACE_MALLOC_PADDING,
00057               ACE_MALLOC_HEADER_SIZE,
00058               ACE_PI_MALLOC_PADDING_SIZE,
00059               ACE_PI_CONTROL_BLOCK_SIZE,
00060               ACE_PI_CONTROL_BLOCK_ALIGN_LONGS,
00061               sizeof (ACE_Malloc_Header),
00062               sizeof (ACE_PI_Control_Block)
00063               ));
00064   ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("End <--- ACE_PI_Control_Block::print_alignment_info:\n")));
00065 }


Member Data Documentation

long ACE_PI_Control_Block::align_[ACE_PI_CONTROL_BLOCK_ALIGN_LONGS < 1 ? 1 : ACE_PI_CONTROL_BLOCK_ALIGN_LONGS]
 

Force alignment.

Definition at line 194 of file PI_Malloc.h.

ACE_Malloc_Header ACE_PI_Control_Block::base_
 

Dummy node used to anchor the freelist. This needs to come last...

Definition at line 198 of file PI_Malloc.h.

Referenced by dump.

MALLOC_HEADER_PTR ACE_PI_Control_Block::freep_
 

Current head of the freelist.

Definition at line 162 of file PI_Malloc.h.

Referenced by dump.

char ACE_PI_Control_Block::lock_name_[MAXNAMELEN]
 

Name of lock thats ensures mutual exclusion.

Definition at line 165 of file PI_Malloc.h.

NAME_NODE_PTR ACE_PI_Control_Block::name_head_
 

Head of the linked list of Name Nodes.

Definition at line 159 of file PI_Malloc.h.

Referenced by dump.

int ACE_PI_Control_Block::ref_counter_
 

Reference counter.

Definition at line 156 of file PI_Malloc.h.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:52:00 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002