Exemple #1
0
        public static void TraceAllocation(ITracableObject source)
        {
            var       hashCode = source.GetHashCode();
            TraceItem item     = null;

            if (_taskSourceDict.TryGetValue(hashCode, out item))
            {
                item.ResetTarget(source);
            }
            else
            {
                item = new TraceItem(source);
                _taskSourceDict.Add(hashCode, item);
            }
            if (EnableStack)
            {
                item.StackTrace = GetStackTrace();
            }
            else
            {
                item.StackTrace = DEFAULT_EMPTY_STACK_STACE;
            }
            if (onTraceUpdate != null)
            {
                onTraceUpdate();
            }
        }
Exemple #2
0
 public static void TraceReturn(ITracableObject source)
 {
     _taskSourceDict.Remove(source.GetHashCode());
     if (onTraceUpdate != null)
     {
         onTraceUpdate();
     }
 }