Added attribute to ignore refcount check in a function

Hacking a feature together in a ignore-refcount branch of cpychecker
This commit is contained in:
Daniele Varrazzo 2018-12-28 04:20:18 +01:00
parent 16b35ac77b
commit 0b68f344d1
2 changed files with 8 additions and 0 deletions

View File

@ -101,6 +101,7 @@ getnextarg(PyObject *args, Py_ssize_t arglen, Py_ssize_t *p_argidx)
/* wrapper around _Bytes_Resize offering normal Python call semantics */
IGNORE_REFCOUNT
STEALS(1)
Py_LOCAL_INLINE(PyObject *)
resize_bytes(PyObject *b, Py_ssize_t newsize) {

View File

@ -202,4 +202,11 @@ static double round(double num)
#define RAISES
#endif
#if defined(WITH_CPYCHECKER_IGNORE_REFCOUNT_ATTRIBUTE)
#define IGNORE_REFCOUNT \
__attribute__((cpychecker_ignore_refcount))
#else
#define IGNORE_REFCOUNT
#endif
#endif /* !defined(PSYCOPG_CONFIG_H) */