MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / ~InitCDS

Method ~InitCDS

src/jrd/InitCDSLib.cpp:60–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60InitCDS::~InitCDS()
61{
62 cds::gc::dhp::smr::destruct(true);
63
64 char str[512];
65
66// CDS_ENABLE_HPSTAT is not defined by default.
67// Rebuild of libcds after change is required.
68
69#ifdef CDS_ENABLE_HPSTAT
70 cds::gc::DHP::stat const& st = cds::gc::DHP::postmortem_statistics();
71
72 sprintf(str, "DHP statistics:\n"
73 " thread count = %llu\n"
74 " guard allocated = %llu\n"
75 " guard freed = %llu\n"
76 " retired data count = %llu\n"
77 " free data count = %llu\n"
78 " HP blocks allocated = %llu\n"
79 " retired blocks allocated = %llu\n"
80 " hp array extend() calls = %llu\n"
81 " retired array extend() = %llu\n"
82 " scan() call count = %llu\n"
83 " help_scan() call count = %llu\n"
84 "\n",
85 st.thread_rec_count,
86 st.guard_allocated, st.guard_freed,
87 st.retired_count, st.free_count,
88 st.hp_block_count, st.retired_block_count,
89 st.hp_extend_count, st.retired_extend_count,
90 st.scan_count, st.help_scan_count
91 );
92 gds__log(str);
93#endif
94 cds::Terminate();
95
96 // no need to protect m_pools at this point
97 while (m_pools->hasData())
98 {
99 MemoryPool* pool = m_pools->pop();
100 MemoryPool::deletePool(pool);
101 }
102
103 delete m_pools;
104 MemoryPool::deletePool(m_pool);
105
106#ifdef DEBUG_CDS_MEMORY
107 sprintf(str, "DHP pool stats:\n"
108 " usage = %llu\n"
109 " mapping = %llu\n"
110 " max usage = %llu\n"
111 " max mapping = %llu\n"
112 "\n",
113 m_stats.getCurrentUsage(),
114 m_stats.getCurrentMapping(),
115 m_stats.getMaximumUsage(),
116 m_stats.getMaximumMapping()
117 );

Callers

nothing calls this directly

Calls 7

TerminateFunction · 0.85
getCurrentUsageMethod · 0.80
getCurrentMappingMethod · 0.80
getMaximumUsageMethod · 0.80
getMaximumMappingMethod · 0.80
hasDataMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected