lkml.org 
[lkml]   [2010]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] trace-event-python: give field dict to unhandled callback
From
> The if statement expands to:
>
> if (!handler)
>  if ( --(dict)->ob_refcnt != 0) ; else
> ( (*((PyObject*)(dict))->ob_type->tp_dealloc)((PyObject *)((PyObject
> *)(dict))));
>
yeah, in python2.6 at least, Py_DECREF is protected by do{ } while(0)
#define Py_DECREF(op) \
do { \
if (_Py_DEC_REFTOTAL _Py_REF_DEBUG_COMMA \
--((PyObject*)(op))->ob_refcnt != 0) \
_Py_CHECK_REFCNT(op) \
else \
_Py_Dealloc((PyObject *)(op)); \
} while (0)

> if (!handler) {
> Py_DECREF(dict);
> }

See a simpler fix in my next email.

--
Pierre
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-05-31 23:09    [W:0.065 / U:0.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site