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

Function main

Tools/MemDumpAnalysis/MemDumpAnalysis.cpp:282–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280
281
282int main(int argc, char * argv[])
283{
284 // Open the dump file:
285 cFile f("memdump.xml", cFile::fmRead);
286 if (!f.IsOpen())
287 {
288 printf("Cannot open memdump.xml\n");
289 return 1;
290 }
291
292 // Create the XML parser:
293 XML_Parser Parser = XML_ParserCreate(NULL);
294 XML_SetElementHandler(Parser, OnStartElement, OnEndElement);
295
296 // Feed the file through XML parser:
297 char Buffer[512 KiB];
298 while (true)
299 {
300 int NumBytes = f.Read(Buffer, sizeof(Buffer));
301 if (NumBytes <= 0)
302 {
303 break;
304 }
305 XML_Parse(Parser, Buffer, NumBytes, false);
306 putc('.', stdout);
307 }
308 XML_Parse(Parser, "", 0, true);
309 f.Close();
310
311 // Output the statistics
312 WriteSizeStatistics();
313 WriteCountStatistics();
314 WriteDotGraph();
315
316 return 0;
317}
318
319
320

Callers

nothing calls this directly

Calls 9

XML_ParserCreateFunction · 0.85
XML_SetElementHandlerFunction · 0.85
XML_ParseFunction · 0.85
WriteSizeStatisticsFunction · 0.85
WriteCountStatisticsFunction · 0.85
WriteDotGraphFunction · 0.85
IsOpenMethod · 0.80
ReadMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected