Example #1
0
static void _EmulatedDecRef(PyObject *o)
{
    #define _Py_Dealloc(op) \
        (*(op)->ob_type->tp_dealloc)((PyObject *)(op))

    OldPyObject *oo = (OldPyObject*)o;
    if (--(oo)->ob_refcnt == 0)
        _Py_Dealloc(oo);
}
Example #2
0
void _XDECREF( PyObject *op )
{
    // This function must match the contents of Py_XDECREF(op);
    if( op == NULL )
        return;

#ifdef Py_REF_DEBUG
    (*ptr_Py_RefTotal)--;
#endif

    if (--(op)->ob_refcnt == 0)
        _Py_Dealloc((PyObject *)(op));
}