From: <ni...@us...> - 2009-03-17 14:02:21
|
Revision: 493 http://mspsim.svn.sourceforge.net/mspsim/?rev=493&view=rev Author: nifi Date: 2009-03-17 14:02:13 +0000 (Tue, 17 Mar 2009) Log Message: ----------- fixed call stack to grow on demand Modified Paths: -------------- mspsim/se/sics/mspsim/util/SimpleProfiler.java Modified: mspsim/se/sics/mspsim/util/SimpleProfiler.java =================================================================== --- mspsim/se/sics/mspsim/util/SimpleProfiler.java 2009-03-17 13:56:24 UTC (rev 492) +++ mspsim/se/sics/mspsim/util/SimpleProfiler.java 2009-03-17 14:02:13 UTC (rev 493) @@ -78,7 +78,7 @@ startTags = new HashMap<String, TagEntry>(); endTags = new HashMap<String, TagEntry>(); ignoreFunctions = new HashMap<String, String>(); - callStack = new CallEntry[2048]; + callStack = new CallEntry[64]; servicedInterrupt = -1; } @@ -95,6 +95,11 @@ } public void profileCall(MapEntry entry, long cycles) { + if (cSP == callStack.length) { + CallEntry[] tmp = new CallEntry[cSP + 64]; + System.arraycopy(callStack, 0, tmp, 0, cSP); + callStack = tmp; + } if (callStack[cSP] == null) { callStack[cSP] = new CallEntry(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |