Skip to content

Commit a529dbb

Browse files
committed
Added attribute to ignore refcount check in a function
Hacking a feature together in a ignore-refcount branch of cpychecker
1 parent 65a2a18 commit a529dbb

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

psycopg/bytes_format.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ getnextarg(PyObject *args, Py_ssize_t arglen, Py_ssize_t *p_argidx)
101101

102102
/* wrapper around _Bytes_Resize offering normal Python call semantics */
103103

104+
IGNORE_REFCOUNT
104105
STEALS(1)
105106
Py_LOCAL_INLINE(PyObject *)
106107
resize_bytes(PyObject *b, Py_ssize_t newsize) {

psycopg/config.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,4 +202,11 @@ static double round(double num)
202202
#define RAISES
203203
#endif
204204

205+
#if defined(WITH_CPYCHECKER_IGNORE_REFCOUNT_ATTRIBUTE)
206+
#define IGNORE_REFCOUNT \
207+
__attribute__((cpychecker_ignore_refcount))
208+
#else
209+
#define IGNORE_REFCOUNT
210+
#endif
211+
205212
#endif /* !defined(PSYCOPG_CONFIG_H) */

0 commit comments

Comments
 (0)