sysperfana/analyzetoolext/com.nokia.s60tools.analyzetool/src/com/nokia/s60tools/analyzetool/engine/statistic/AllocInfo.java
changeset 6 f65f740e69f9
parent 1 1050670c6980
child 15 0367d2db2c06
equal deleted inserted replaced
5:844b047e260d 6:f65f740e69f9
     1 /*
     1 /*
     2  * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     2  * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     3  * All rights reserved.
     3  * All rights reserved.
     4  * This component and the accompanying materials are made available
     4  * This component and the accompanying materials are made available
     5  * under the terms of "Eclipse Public License v1.0"
     5  * under the terms of "Eclipse Public License v1.0"
     6  * which accompanies this distribution, and is available
     6  * which accompanies this distribution, and is available
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    22  * Class holds information of one memory allocation
    22  * Class holds information of one memory allocation
    23  * @author kihe
    23  * @author kihe
    24  *
    24  *
    25  */
    25  */
    26 public class AllocInfo extends BaseInfo {
    26 public class AllocInfo extends BaseInfo {
       
    27 
       
    28 	/**
       
    29 	 * Constructor
       
    30 	 * @param memoryAddress memory address for this allocation
       
    31 	 */
       
    32 	public AllocInfo(String memoryAddress) {
       
    33 		super(memoryAddress);
       
    34 	}
    27 
    35 
    28 	private FreeInfo freedBy = null;
    36 	private FreeInfo freedBy = null;
    29 
    37 
    30 	/**
    38 	/**
    31 	 * set this allocation as freed by the provide FreeInfo
    39 	 * set this allocation as freed by the provide FreeInfo
    48 	 * @return boolean true/false
    56 	 * @return boolean true/false
    49 	 */
    57 	 */
    50 	public boolean isFreed() {
    58 	public boolean isFreed() {
    51 		return this.freedBy != null;
    59 		return this.freedBy != null;
    52 	}
    60 	}
       
    61 
       
    62 	@Override
       
    63 	public String toString() {
       
    64 		return String.format("AllocInfo [%s freedBy=[%s]]", super.toString(), freedByToString());
       
    65 	}
       
    66 	
       
    67 	private String freedByToString(){
       
    68 		if (freedBy == null){
       
    69 			return "null";
       
    70 		}
       
    71 		
       
    72 		return String.format("addr=0x%08X time=%s", freedBy.getMemoryAddress(), freedBy.getTime());
       
    73 	}
    53 }
    74 }