1 #ifndef ACE_PI_MALLOC_CPP
2 #define ACE_PI_MALLOC_CPP
4 #include "ace/PI_Malloc.h"
6 #if (ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1)
8 #if !defined (__ACE_INLINE__)
9 #include "ace/PI_Malloc.inl"
10 #endif /* __ACE_INLINE__ */
12 #include "ace/Object_Manager.h"
13 #include "ace/Process_Mutex.h"
14 #include "ace/OS_NS_string.h"
16 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
19 ACE_PI_Control_Block::ACE_Malloc_Header::dump () const
21 #if defined (ACE_HAS_DUMP)
22 ACE_TRACE ("ACE_PI_Control_Block::ACE_Malloc_Header::dump");
24 ACELIB_DEBUG ((LM_DEBUG
, ACE_BEGIN_DUMP
, this));
25 ACELIB_DEBUG ((LM_DEBUG
, ACE_TEXT ("\nnext_block = %x"), (ACE_Malloc_Header
*) this->next_block_
));
26 ACELIB_DEBUG ((LM_DEBUG
, ACE_TEXT ("\nsize = %d\n"), this->size_
));
27 ACELIB_DEBUG ((LM_DEBUG
, ACE_END_DUMP
));
28 #endif /* ACE_HAS_DUMP */
32 ACE_PI_Control_Block::print_alignment_info ()
34 #if defined (ACE_HAS_DUMP)
35 ACE_TRACE ("ACE_PI_Control_Block::ACE_Control_Block::print_alignment_info");
36 ACELIB_DEBUG ((LM_DEBUG
, ACE_TEXT ("Start ---> ACE_PI_Control_Block::print_alignment_info:\n")));
37 ACELIB_DEBUG ((LM_DEBUG
,
38 ACE_TEXT ("Sizeof ptr: %d\n")
39 ACE_TEXT ("Sizeof size_t: %d\n")
40 ACE_TEXT ("Sizeof long: %d\n")
41 ACE_TEXT ("Sizeof double: %d\n")
42 ACE_TEXT ("Sizeof ACE_MALLOC_ALIGN: %d\n")
43 ACE_TEXT ("sizeof ACE_MALLOC_PADDING: %d\n")
44 ACE_TEXT ("Sizeof ACE_MALLOC_HEADER_SIZE: %d\n")
45 ACE_TEXT ("Sizeof ACE_PI_MALLOC_PADDING_SIZE: %d\n")
46 ACE_TEXT ("Sizeof ACE_PI_CONTROL_BLOCK_SIZE: %d\n")
47 ACE_TEXT ("Sizeof ACE_PI_CONTROL_BLOCK_ALIGN_BYTES: %d\n")
48 ACE_TEXT ("Sizeof (MALLOC_HEADER): %d\n")
49 ACE_TEXT ("Sizeof (CONTROL_BLOCK): %d\n"),
56 ACE_MALLOC_HEADER_SIZE
,
57 ACE_PI_MALLOC_PADDING_SIZE
,
58 ACE_PI_CONTROL_BLOCK_SIZE
,
59 ACE_PI_CONTROL_BLOCK_ALIGN_BYTES
,
60 sizeof (ACE_Malloc_Header
),
61 sizeof (ACE_PI_Control_Block
)
63 ACELIB_DEBUG ((LM_DEBUG
, ACE_TEXT ("End <--- ACE_PI_Control_Block::print_alignment_info:\n")));
64 #endif /* ACE_HAS_DUMP */
68 ACE_PI_Control_Block::dump () const
70 #if defined (ACE_HAS_DUMP)
71 ACE_TRACE ("ACE_PI_Control_Block::dump");
73 ACELIB_DEBUG ((LM_DEBUG
, ACE_BEGIN_DUMP
, this));
74 ACELIB_DEBUG ((LM_DEBUG
, ACE_TEXT ("Name Node:\n")));
75 for (ACE_Name_Node
*nextn
= this->name_head_
;
80 ACELIB_DEBUG ((LM_DEBUG
, ACE_TEXT ("freep_ = %x"), (ACE_Malloc_Header
*) this->freep_
));
83 ACELIB_DEBUG ((LM_DEBUG
, ACE_TEXT ("\nMalloc Header:\n")));
84 for (ACE_Malloc_Header
*nexth
= ((ACE_Malloc_Header
*)this->freep_
)->next_block_
;
85 nexth
!= 0 && nexth
!= &this->base_
;
86 nexth
= nexth
->next_block_
)
89 ACELIB_DEBUG ((LM_DEBUG
, ACE_TEXT ("\n")));
90 ACELIB_DEBUG ((LM_DEBUG
, ACE_END_DUMP
));
91 #endif /* ACE_HAS_DUMP */
94 ACE_PI_Control_Block::ACE_Name_Node::ACE_Name_Node ()
96 ACE_TRACE ("ACE_PI_Control_Block::ACE_Name_Node::ACE_Name_Node");
99 ACE_PI_Control_Block::ACE_Name_Node::ACE_Name_Node (const char *name
,
108 ACE_TRACE ("ACE_PI_Control_Block::ACE_Name_Node::ACE_Name_Node");
109 char *n
= this->name_
;
110 ACE_OS::strcpy (n
, name
);
115 ACE_PI_Control_Block::ACE_Name_Node::ACE_Name_Node (const ACE_Name_Node
&)
117 ACE_TRACE ("ACE_PI_Control_Block::ACE_Name_Node::ACE_Name_Node");
118 ACE_ASSERT (0); // not implemented!
122 ACE_PI_Control_Block::ACE_Name_Node::name () const
128 ACE_PI_Control_Block::ACE_Name_Node::name (const char *)
130 ACE_ASSERT (0); // not implemented yet.
133 ACE_PI_Control_Block::ACE_Malloc_Header::ACE_Malloc_Header ()
140 ACE_PI_Control_Block::ACE_Name_Node::dump () const
142 #if defined (ACE_HAS_DUMP)
143 ACE_TRACE ("ACE_PI_Control_Block::ACE_Name_Node::dump");
145 ACELIB_DEBUG ((LM_DEBUG
, ACE_BEGIN_DUMP
, this));
146 ACELIB_DEBUG ((LM_DEBUG
, ACE_TEXT("pointer = %x"), (const char *) this->pointer_
));
147 ACELIB_DEBUG ((LM_DEBUG
, ACE_TEXT("\nnext_ = %x"), (ACE_Name_Node
*) this->next_
));
148 ACELIB_DEBUG ((LM_DEBUG
,
149 ACE_TEXT("\nname_ = (%x, %s)"),
150 (const char *) this->name_
,
151 (const char *) this->name_
));
152 ACELIB_DEBUG ((LM_DEBUG
, ACE_TEXT("\n")));
153 ACELIB_DEBUG ((LM_DEBUG
, ACE_END_DUMP
));
154 #endif /* ACE_HAS_DUMP */
157 ACE_END_VERSIONED_NAMESPACE_DECL
159 #endif /* ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1*/
161 #endif /* ACE_PI_MALLOC_CPP */