diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
tree | 012bb94d777798f1f56ac1cec429509766d05181 /contrib/tools/python3/src/Include/objimpl.h | |
parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
download | ydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/python3/src/Include/objimpl.h')
-rw-r--r-- | contrib/tools/python3/src/Include/objimpl.h | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/contrib/tools/python3/src/Include/objimpl.h b/contrib/tools/python3/src/Include/objimpl.h index 030d7eee29..6def8db83a 100644 --- a/contrib/tools/python3/src/Include/objimpl.h +++ b/contrib/tools/python3/src/Include/objimpl.h @@ -122,30 +122,30 @@ PyAPI_FUNC(PyVarObject *) PyObject_InitVar(PyVarObject *, PyAPI_FUNC(PyObject *) _PyObject_New(PyTypeObject *); PyAPI_FUNC(PyVarObject *) _PyObject_NewVar(PyTypeObject *, Py_ssize_t); -#define PyObject_New(type, typeobj) ((type *)_PyObject_New(typeobj)) - -// Alias to PyObject_New(). In Python 3.8, PyObject_NEW() called directly -// PyObject_MALLOC() with _PyObject_SIZE(). -#define PyObject_NEW(type, typeobj) PyObject_New(type, typeobj) - +#define PyObject_New(type, typeobj) ((type *)_PyObject_New(typeobj)) + +// Alias to PyObject_New(). In Python 3.8, PyObject_NEW() called directly +// PyObject_MALLOC() with _PyObject_SIZE(). +#define PyObject_NEW(type, typeobj) PyObject_New(type, typeobj) + #define PyObject_NewVar(type, typeobj, n) \ ( (type *) _PyObject_NewVar((typeobj), (n)) ) -// Alias to PyObject_New(). In Python 3.8, PyObject_NEW() called directly -// PyObject_MALLOC() with _PyObject_VAR_SIZE(). -#define PyObject_NEW_VAR(type, typeobj, n) PyObject_NewVar(type, typeobj, n) - - -#ifdef Py_LIMITED_API -/* Define PyObject_INIT() and PyObject_INIT_VAR() as aliases to PyObject_Init() - and PyObject_InitVar() in the limited C API for compatibility with the - CPython C API. */ -# define PyObject_INIT(op, typeobj) \ - PyObject_Init(_PyObject_CAST(op), (typeobj)) -# define PyObject_INIT_VAR(op, typeobj, size) \ - PyObject_InitVar(_PyVarObject_CAST(op), (typeobj), (size)) -#else -/* PyObject_INIT() and PyObject_INIT_VAR() are defined in cpython/objimpl.h */ +// Alias to PyObject_New(). In Python 3.8, PyObject_NEW() called directly +// PyObject_MALLOC() with _PyObject_VAR_SIZE(). +#define PyObject_NEW_VAR(type, typeobj, n) PyObject_NewVar(type, typeobj, n) + + +#ifdef Py_LIMITED_API +/* Define PyObject_INIT() and PyObject_INIT_VAR() as aliases to PyObject_Init() + and PyObject_InitVar() in the limited C API for compatibility with the + CPython C API. */ +# define PyObject_INIT(op, typeobj) \ + PyObject_Init(_PyObject_CAST(op), (typeobj)) +# define PyObject_INIT_VAR(op, typeobj, size) \ + PyObject_InitVar(_PyVarObject_CAST(op), (typeobj), (size)) +#else +/* PyObject_INIT() and PyObject_INIT_VAR() are defined in cpython/objimpl.h */ #endif @@ -162,22 +162,22 @@ PyAPI_FUNC(Py_ssize_t) PyGC_Collect(void); PyAPI_FUNC(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, Py_ssize_t); #define PyObject_GC_Resize(type, op, n) \ - ( (type *) _PyObject_GC_Resize(_PyVarObject_CAST(op), (n)) ) + ( (type *) _PyObject_GC_Resize(_PyVarObject_CAST(op), (n)) ) -PyAPI_FUNC(PyObject *) _PyObject_GC_New(PyTypeObject *); -PyAPI_FUNC(PyVarObject *) _PyObject_GC_NewVar(PyTypeObject *, Py_ssize_t); +PyAPI_FUNC(PyObject *) _PyObject_GC_New(PyTypeObject *); +PyAPI_FUNC(PyVarObject *) _PyObject_GC_NewVar(PyTypeObject *, Py_ssize_t); -/* Tell the GC to track this object. - * - * See also private _PyObject_GC_TRACK() macro. */ -PyAPI_FUNC(void) PyObject_GC_Track(void *); +/* Tell the GC to track this object. + * + * See also private _PyObject_GC_TRACK() macro. */ +PyAPI_FUNC(void) PyObject_GC_Track(void *); /* Tell the GC to stop tracking this object. - * - * See also private _PyObject_GC_UNTRACK() macro. */ -PyAPI_FUNC(void) PyObject_GC_UnTrack(void *); + * + * See also private _PyObject_GC_UNTRACK() macro. */ +PyAPI_FUNC(void) PyObject_GC_UnTrack(void *); PyAPI_FUNC(void) PyObject_GC_Del(void *); @@ -186,8 +186,8 @@ PyAPI_FUNC(void) PyObject_GC_Del(void *); #define PyObject_GC_NewVar(type, typeobj, n) \ ( (type *) _PyObject_GC_NewVar((typeobj), (n)) ) -PyAPI_FUNC(int) PyObject_GC_IsTracked(PyObject *); -PyAPI_FUNC(int) PyObject_GC_IsFinalized(PyObject *); +PyAPI_FUNC(int) PyObject_GC_IsTracked(PyObject *); +PyAPI_FUNC(int) PyObject_GC_IsFinalized(PyObject *); /* Utility macro to help write tp_traverse functions. * To use this macro, the tp_traverse function must name its arguments @@ -197,17 +197,17 @@ PyAPI_FUNC(int) PyObject_GC_IsFinalized(PyObject *); #define Py_VISIT(op) \ do { \ if (op) { \ - int vret = visit(_PyObject_CAST(op), arg); \ + int vret = visit(_PyObject_CAST(op), arg); \ if (vret) \ return vret; \ } \ } while (0) -#ifndef Py_LIMITED_API -# define Py_CPYTHON_OBJIMPL_H -# include "cpython/objimpl.h" -# undef Py_CPYTHON_OBJIMPL_H -#endif +#ifndef Py_LIMITED_API +# define Py_CPYTHON_OBJIMPL_H +# include "cpython/objimpl.h" +# undef Py_CPYTHON_OBJIMPL_H +#endif #ifdef __cplusplus } |