Mark getnextarg function as returning a borrowed reference

This commit is contained in:
Daniele Varrazzo 2012-02-24 04:25:08 +00:00
parent fc78fb09c0
commit 5f3f35a2c2
2 changed files with 9 additions and 0 deletions

View File

@ -86,6 +86,7 @@
/* Helpers for formatstring */ /* Helpers for formatstring */
CPYCHECKER_RETURNS_BORROWED_REF
Py_LOCAL_INLINE(PyObject *) Py_LOCAL_INLINE(PyObject *)
getnextarg(PyObject *args, Py_ssize_t arglen, Py_ssize_t *p_argidx) getnextarg(PyObject *args, Py_ssize_t arglen, Py_ssize_t *p_argidx)
{ {

View File

@ -160,4 +160,12 @@ static double round(double num)
#define isinf(x) (!finite((x)) && (x)==(x)) #define isinf(x) (!finite((x)) && (x)==(x))
#endif #endif
/* decorator for the gcc cpychecker plugin */
#if defined(WITH_CPYCHECKER_RETURNS_BORROWED_REF_ATTRIBUTE)
#define CPYCHECKER_RETURNS_BORROWED_REF \
__attribute__((cpychecker_returns_borrowed_ref))
#else
#define CPYCHECKER_RETURNS_BORROWED_REF
#endif
#endif /* !defined(PSYCOPG_CONFIG_H) */ #endif /* !defined(PSYCOPG_CONFIG_H) */