public static void Free(NSJSStackTrace *stacktrace) { if (stacktrace != null) { NSJSStackFrame *stackframes = stacktrace->Frame; if (stackframes != null) { NSJSMemoryManagement.Free(stackframes); } NSJSMemoryManagement.Free(stacktrace); } }
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); }