#include <PI_Malloc.h>
Collaboration diagram for ACE_PI_Control_Block:
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 Member Functions | |
void | dump (void) const |
Dump the state of the object. | |
Static Public Member Functions | |
void | print_alignment_info (void) |
Print out a bunch of size info for debugging. | |
Public Attributes | |
int | ref_counter_ |
Reference counter. | |
NAME_NODE_PTR | name_head_ |
Head of the linked list of Name Nodes. | |
MALLOC_HEADER_PTR | freep_ |
Current head of the freelist. | |
char | lock_name_ [MAXNAMELEN] |
Name of lock thats ensures mutual exclusion. | |
char | align_ [(ACE_PI_CONTROL_BLOCK_ALIGN_BYTES)?ACE_PI_CONTROL_BLOCK_ALIGN_BYTES:ACE_MALLOC_ALIGN] |
Force alignment. | |
ACE_Malloc_Header | base_ |
Dummy node used to anchor the freelist. This needs to come last... | |
Private Member Functions | |
void | operator= (const ACE_Control_Block &) |
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 44 of file PI_Malloc.h.
|
Definition at line 52 of file PI_Malloc.h. |
|
Definition at line 50 of file PI_Malloc.h. |
|
Definition at line 51 of file PI_Malloc.h. |
|
Dump the state of the object.
Definition at line 72 of file PI_Malloc.cpp. References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_LIB_TEXT, ACE_TRACE, ACE_PI_Control_Block::ACE_Malloc_Header::dump(), ACE_PI_Control_Block::ACE_Name_Node::dump(), LM_DEBUG, ACE_PI_Control_Block::ACE_Name_Node::next_, and ACE_PI_Control_Block::ACE_Malloc_Header::next_block_.
00073 { 00074 #if defined (ACE_HAS_DUMP) 00075 ACE_TRACE ("ACE_PI_Control_Block::dump"); 00076 00077 ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); 00078 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("Name Node:\n"))); 00079 for (ACE_Name_Node *nextn = this->name_head_; 00080 nextn != 0; 00081 nextn = nextn->next_) 00082 nextn->dump (); 00083 00084 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("freep_ = %x"), (ACE_Malloc_Header *) this->freep_)); 00085 this->base_.dump (); 00086 00087 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nMalloc Header:\n"))); 00088 for (ACE_Malloc_Header *nexth = ((ACE_Malloc_Header *)this->freep_)->next_block_; 00089 nexth != 0 && nexth != &this->base_; 00090 nexth = nexth->next_block_) 00091 nexth->dump (); 00092 00093 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\n"))); 00094 ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); 00095 #endif /* ACE_HAS_DUMP */ 00096 } |
|
|
|
Print out a bunch of size info for debugging.
Definition at line 36 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_BYTES, ACE_PI_CONTROL_BLOCK_SIZE, ACE_PI_MALLOC_PADDING_SIZE, ACE_TRACE, and LM_DEBUG.
00037 { 00038 #if defined (ACE_HAS_DUMP) 00039 ACE_TRACE ("ACE_PI_Control_Block::ACE_Control_Block::print_alignment_info"); 00040 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("Start ---> ACE_PI_Control_Block::print_alignment_info:\n"))); 00041 ACE_DEBUG ((LM_DEBUG, 00042 ACE_LIB_TEXT ("Sizeof ptr: %d\n") 00043 ACE_LIB_TEXT ("Sizeof size_t: %d\n") 00044 ACE_LIB_TEXT ("Sizeof long: %d\n") 00045 ACE_LIB_TEXT ("Sizeof double: %d\n") 00046 ACE_LIB_TEXT ("Sizeof ACE_MALLOC_ALIGN: %d\n") 00047 ACE_LIB_TEXT ("sizeof ACE_MALLOC_PADDING: %d\n") 00048 ACE_LIB_TEXT ("Sizeof ACE_MALLOC_HEADER_SIZE: %d\n") 00049 ACE_LIB_TEXT ("Sizeof ACE_PI_MALLOC_PADDING_SIZE: %d\n") 00050 ACE_LIB_TEXT ("Sizeof ACE_PI_CONTROL_BLOCK_SIZE: %d\n") 00051 ACE_LIB_TEXT ("Sizeof ACE_PI_CONTROL_BLOCK_ALIGN_BYTES: %d\n") 00052 ACE_LIB_TEXT ("Sizeof (MALLOC_HEADER): %d\n") 00053 ACE_LIB_TEXT ("Sizeof (CONTROL_BLOCK): %d\n"), 00054 sizeof (char *), 00055 sizeof (size_t), 00056 sizeof (long), 00057 sizeof (double), 00058 ACE_MALLOC_ALIGN, 00059 ACE_MALLOC_PADDING, 00060 ACE_MALLOC_HEADER_SIZE, 00061 ACE_PI_MALLOC_PADDING_SIZE, 00062 ACE_PI_CONTROL_BLOCK_SIZE, 00063 ACE_PI_CONTROL_BLOCK_ALIGN_BYTES, 00064 sizeof (ACE_Malloc_Header), 00065 sizeof (ACE_PI_Control_Block) 00066 )); 00067 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("End <--- ACE_PI_Control_Block::print_alignment_info:\n"))); 00068 #endif /* ACE_HAS_DUMP */ 00069 } |
|
Force alignment.
Definition at line 189 of file PI_Malloc.h. |
|
Dummy node used to anchor the freelist. This needs to come last...
Definition at line 192 of file PI_Malloc.h. |
|
Current head of the freelist.
Definition at line 164 of file PI_Malloc.h. |
|
Name of lock thats ensures mutual exclusion.
Definition at line 167 of file PI_Malloc.h. |
|
Head of the linked list of Name Nodes.
Definition at line 161 of file PI_Malloc.h. |
|
Reference counter.
Definition at line 158 of file PI_Malloc.h. |