sysperfana/analyzetoolext/com.nokia.s60tools.analyzetool/src/com/nokia/s60tools/analyzetool/engine/statistic/AllocInfo.java
changeset 6 f65f740e69f9
parent 1 1050670c6980
child 15 0367d2db2c06
--- a/sysperfana/analyzetoolext/com.nokia.s60tools.analyzetool/src/com/nokia/s60tools/analyzetool/engine/statistic/AllocInfo.java	Wed Apr 21 15:14:16 2010 +0300
+++ b/sysperfana/analyzetoolext/com.nokia.s60tools.analyzetool/src/com/nokia/s60tools/analyzetool/engine/statistic/AllocInfo.java	Wed Apr 21 19:42:48 2010 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+ * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
  * All rights reserved.
  * This component and the accompanying materials are made available
  * under the terms of "Eclipse Public License v1.0"
@@ -25,6 +25,14 @@
  */
 public class AllocInfo extends BaseInfo {
 
+	/**
+	 * Constructor
+	 * @param memoryAddress memory address for this allocation
+	 */
+	public AllocInfo(String memoryAddress) {
+		super(memoryAddress);
+	}
+
 	private FreeInfo freedBy = null;
 
 	/**
@@ -50,4 +58,17 @@
 	public boolean isFreed() {
 		return this.freedBy != null;
 	}
+
+	@Override
+	public String toString() {
+		return String.format("AllocInfo [%s freedBy=[%s]]", super.toString(), freedByToString());
+	}
+	
+	private String freedByToString(){
+		if (freedBy == null){
+			return "null";
+		}
+		
+		return String.format("addr=0x%08X time=%s", freedBy.getMemoryAddress(), freedBy.getTime());
+	}
 }