void printSummaryToListBox(int numAllocs, int totalAllocSize) { listBox1.Items.Add("============================================="); listBox1.Items.Add("============================================="); listBox1.Items.Add("Total Allocation Size : " + MemoryNumber.convert(totalAllocSize)); listBox1.Items.Add("Total Allocations : " + numAllocs); }
//================================================== public string getFullText() { string result = ""; if (file == "") { result = "Total : " + MemoryNumber.convert(getInclusiveMemory()); } else { string incExl = isMemoryChildrenInclusive()? " inclusive" : ""; string sampleText = getSampleString(); if (String.IsNullOrEmpty(sampleText)) { result = getFileLineFunctionText() + ":" + " [" + MemoryNumber.convert(getInclusiveMemory()) + incExl + "]"; } else { result = getFileLineFunctionText() + ":" + " [" + MemoryNumber.convert(getInclusiveMemory()) + incExl + "] (" + getSampleString() + ")"; } } return(result); }
void addAllocToListBox(allocXML alloc) { listBox1.Items.Add("============================================="); listBox1.Items.Add("Allocation Size : " + MemoryNumber.convert(Int32.Parse(alloc.size)) + " address : 0x" + uint.Parse(alloc.address).ToString("x")); string tab = ""; for (int stackIndex = 0; stackIndex < alloc.stack.Count; stackIndex++) { listBox1.Items.Add(tab + alloc.stack[stackIndex].function + "(" + alloc.stack[stackIndex].file + ", line: " + alloc.stack[stackIndex].line + ")"); tab += " "; } }
//================================================== public string getSampleString() { string retval = ""; bool first = true; foreach (allocTreeSampleData sample in accumulatedSamples) { if (!first) { retval = retval + ", "; } retval = retval + MemoryNumber.convert(sample.size); first = false; } return(retval); }
public string toClipboardStringOneLevel() { string outString = ""; Stack <string> parentStrings = new Stack <string>(); //walk parents of me. allocTreeNode parent = (allocTreeNode)this.Parent; while (parent != null) { parentStrings.Push(parent.getFileLineFunctionText() + ":" + " [" + MemoryNumber.convert(getInclusiveMemory()) + "]"); parent = (allocTreeNode)parent.Parent; } parentStrings.Pop();//we don't care about the topmost entry while (parentStrings.Count != 0) { outString += parentStrings.Pop() + "\n"; } outString += getFullText(); for (int i = 0; i < Nodes.Count; i++) { allocTreeNode knode = Nodes[i] as allocTreeNode; if (knode == null) { continue; } outString += "\n" + knode.getFullText(); } return(outString); }