예제 #1
0
 public static void Free(NSJSStackTrace *stacktrace)
 {
     if (stacktrace != null)
     {
         NSJSStackFrame *stackframes = stacktrace->Frame;
         if (stackframes != null)
         {
             NSJSMemoryManagement.Free(stackframes);
         }
         NSJSMemoryManagement.Free(stacktrace);
     }
 }
예제 #2
0
            public static NSJSStackTrace *New()
            {
                NSJSStackTrace *stacktrace = (NSJSStackTrace *)NSJSMemoryManagement.Alloc(sizeof(NSJSStackTrace));

                if (stacktrace == null)
                {
                    throw new InvalidOperationException("stacktrace");
                }
                stacktrace->Count = 0;
                int cb = sizeof(NSJSStackFrame) * MAXSTACKFRAMECOUNT;

                stacktrace->Frame = (NSJSStackFrame *)NSJSMemoryManagement.Alloc(cb);
                if (stacktrace->Frame == null)
                {
                    throw new InvalidOperationException("stackframes");
                }
                return(stacktrace);
            }