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

ACE_Control_Block Class Reference

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

#include <Malloc.h>

List of all members.

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...

ACE_Name_Nodename_head_
 Head of the linked list of Name Nodes. More...

ACE_Malloc_Headerfreep_
 Current head of the freelist. More...

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

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

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


Detailed Description

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

This class defines the "old" control block class for use in ACE_Malloc_T. This control block implementation is considerable more efficient than the "position independent" one below (ACE_PI_Control_Block) but if you are going to use it to construct a ACE_Malloc_T and access the memory from several different processes, you must "map" the underlying memory pool to the same address.

Definition at line 258 of file Malloc.h.


Member Function Documentation

void ACE_Control_Block::dump void    const
 

Dump the state of the object.

Definition at line 72 of file Malloc.cpp.

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

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

void ACE_Control_Block::print_alignment_info void    [static]
 

Print out a bunch of size info for debugging.

Definition at line 38 of file Malloc.cpp.

References ACE_CONTROL_BLOCK_ALIGN_LONGS, ACE_CONTROL_BLOCK_SIZE, ACE_DEBUG, ACE_LIB_TEXT, ACE_MALLOC_ALIGN, ACE_MALLOC_HEADER_SIZE, ACE_MALLOC_PADDING, ACE_MALLOC_PADDING_SIZE, ACE_TRACE, and LM_DEBUG.

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


Member Data Documentation

long ACE_Control_Block::align_[ACE_CONTROL_BLOCK_ALIGN_LONGS < 1 ? 1 : ACE_CONTROL_BLOCK_ALIGN_LONGS]
 

Force alignment.

Definition at line 398 of file Malloc.h.

ACE_Malloc_Header ACE_Control_Block::base_
 

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

Definition at line 402 of file Malloc.h.

Referenced by dump.

ACE_Malloc_Header* ACE_Control_Block::freep_
 

Current head of the freelist.

Definition at line 366 of file Malloc.h.

Referenced by dump.

char ACE_Control_Block::lock_name_[MAXNAMELEN]
 

Name of lock thats ensures mutual exclusion.

Definition at line 369 of file Malloc.h.

ACE_Name_Node* ACE_Control_Block::name_head_
 

Head of the linked list of Name Nodes.

Definition at line 363 of file Malloc.h.

Referenced by dump.

int ACE_Control_Block::ref_counter_
 

Reference counter.

Definition at line 360 of file Malloc.h.


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