MCPcopy Create free account
hub / github.com/cuberite/cuberite / WriteSizeStatistics

Function WriteSizeStatistics

Tools/MemDumpAnalysis/MemDumpAnalysis.cpp:168–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166
167
168void WriteSizeStatistics(void)
169{
170 typedef std::vector<std::pair<AString, int> > StringIntPairs;
171 StringIntPairs FnSizes;
172
173 cFile f("memdump_totals.txt", cFile::fmWrite);
174 if (!f.IsOpen())
175 {
176 LOGERROR("Cannot open memdump_totals.txt");
177 return;
178 }
179
180 for (FunctionMap::iterator itr = g_FnMap.begin(), end = g_FnMap.end(); itr != end; ++itr)
181 {
182 FnSizes.push_back(std::pair<AString, int>(itr->first, itr->second.m_Size));
183 } // for itr - g_FnSizes[]
184 std::sort(FnSizes.begin(), FnSizes.end(), CompareFnInt);
185
186 for (StringIntPairs::const_iterator itr = FnSizes.begin(), end = FnSizes.end(); itr != end; ++itr)
187 {
188 f.Printf("%d\t%s\n", itr->second, itr->first.c_str());
189 } // for itr - FnSizes[]
190}
191
192
193

Callers 1

mainFunction · 0.85

Calls 7

LOGERRORFunction · 0.85
sortFunction · 0.85
IsOpenMethod · 0.80
beginMethod · 0.80
endMethod · 0.80
PrintfMethod · 0.80
c_strMethod · 0.80

Tested by

no test coverage detected