static void profiler_dealloc(ProfilerObject *op) { if (op->flags & POF_ENABLED) PyEval_SetProfile(NULL, NULL); flush_unmatched(op); clearEntries(op); Py_XDECREF(op->externalTimer); Py_TYPE(op)->tp_free(op); }
static int flush_unmatched_enum(rotating_node_t *n, void *arg) { ProfilerStack *t = (ProfilerStack*)n; ProfilerObject *pObj = (ProfilerObject*)arg; pObj->currentProfilerStack = t; flush_unmatched(pObj); free(t); return 0; }
static PyObject* profiler_disable(ProfilerObject *self, PyObject* noarg) { self->flags &= ~POF_ENABLED; PyEval_SetProfile(NULL, NULL); flush_unmatched(self); if (pending_exception(self)) return NULL; Py_INCREF(Py_None); return Py_None; }