summaryrefslogtreecommitdiff
path: root/ace/Malloc.cpp
blob: cbda9a32c61e670593365e2fe5dfca684738f0cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// Malloc.cpp
// $Id$

#if !defined (ACE_MALLOC_C)
#define ACE_MALLOC_C

#define ACE_BUILD_DLL
#include "ace/Malloc.h"

#if !defined (__ACE_INLINE__)
#include "ace/Malloc.i"
#endif /* __ACE_INLINE__ */

void
ACE_Control_Block::dump (void) const
{
  ACE_TRACE ("ACE_Control_Block::dump");

  ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
  this->name_head_->dump ();
  ACE_DEBUG ((LM_DEBUG, "freep_ = %x", this->freep_));

  ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
}

ACE_Name_Node::ACE_Name_Node (void)
{
  ACE_TRACE ("ACE_Name_Node::ACE_Name_Node");
}

ACE_Name_Node::ACE_Name_Node (const char *name, 
			      void *ptr, 
			      ACE_Name_Node *next)
  : pointer_ (ptr), 
    next_ (next)
{
  ACE_TRACE ("ACE_Name_Node::ACE_Name_Node");
  ACE_OS::strcpy (this->name_, name);
}

void
ACE_Name_Node::dump (void) const
{
  ACE_TRACE ("ACE_Name_Node");
  
  ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
  ACE_DEBUG ((LM_DEBUG, "pointer = %x", this->pointer_));
  ACE_DEBUG ((LM_DEBUG, "\nnext_ = %x", this->next_));
  ACE_DEBUG ((LM_DEBUG, "\nname_ = %s", this->name_));
  ACE_DEBUG ((LM_DEBUG, "\n"));
  ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
}

ACE_Allocator::~ACE_Allocator (void)
{
  ACE_TRACE ("ACE_Allocator::~ACE_Allocator");
}

#if defined (ACE_MALLOC_STATS)
ACE_Malloc_Stats::ACE_Malloc_Stats (void)
  : nblocks_ (0), 
    nchunks_ (0), 
    ninuse_ (0) 
{
  ACE_TRACE ("ACE_Malloc_Stats::ACE_Malloc_Stats");
}

void
ACE_Malloc_Stats::dump (void) const
{
  ACE_TRACE ("ACE_Malloc_Stats::print");

  ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
  int nblocks = this->nblocks_;
  int ninuse  = this->ninuse_;
  int nchunks = this->nchunks_;

  ACE_DEBUG ((LM_DEBUG, "nblocks = %d", nblocks));
  ACE_DEBUG ((LM_DEBUG, "\nninuse = %d", ninuse));
  ACE_DEBUG ((LM_DEBUG, "\nnchunks = %d", nchunks));
  ACE_DEBUG ((LM_DEBUG, "\n"));
  ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
}

#if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION)
template class ACE_Atomic_Op<ACE_PROCESS_MUTEX, int>;
#endif /* ACE_TEMPLATES_REQUIRE_SPECIALIZATION */

#endif /* ACE_MALLOC_STATS */
#endif /* ACE_MALLOC_C */