Lines Matching refs:tp
134 PyTypeObject *tp; in _Py_dump_counts() local
135 for (tp = type_list; tp; tp = tp->tp_next) in _Py_dump_counts()
139 tp->tp_name, tp->tp_allocs, tp->tp_frees, in _Py_dump_counts()
140 tp->tp_maxalloc); in _Py_dump_counts()
155 PyTypeObject *tp; in _Py_get_counts() local
162 for (tp = type_list; tp; tp = tp->tp_next) { in _Py_get_counts()
163 v = Py_BuildValue("(snnn)", tp->tp_name, tp->tp_allocs, in _Py_get_counts()
164 tp->tp_frees, tp->tp_maxalloc); in _Py_get_counts()
180 _Py_inc_count(PyTypeObject *tp) in _Py_inc_count() argument
182 if (tp->tp_next == NULL && tp->tp_prev == NULL) { in _Py_inc_count()
184 if (tp->tp_next != NULL) /* sanity check */ in _Py_inc_count()
187 type_list->tp_prev = tp; in _Py_inc_count()
188 tp->tp_next = type_list; in _Py_inc_count()
197 Py_INCREF(tp); in _Py_inc_count()
198 type_list = tp; in _Py_inc_count()
203 _Py_AddToAllObjects((PyObject *)tp, 0); in _Py_inc_count()
206 tp->tp_allocs++; in _Py_inc_count()
207 if (tp->tp_allocs - tp->tp_frees > tp->tp_maxalloc) in _Py_inc_count()
208 tp->tp_maxalloc = tp->tp_allocs - tp->tp_frees; in _Py_inc_count()
211 void _Py_dec_count(PyTypeObject *tp) in _Py_dec_count() argument
213 tp->tp_frees++; in _Py_dec_count()
215 tp->tp_allocs == tp->tp_frees) { in _Py_dec_count()
217 if (tp->tp_prev) in _Py_dec_count()
218 tp->tp_prev->tp_next = tp->tp_next; in _Py_dec_count()
220 type_list = tp->tp_next; in _Py_dec_count()
221 if (tp->tp_next) in _Py_dec_count()
222 tp->tp_next->tp_prev = tp->tp_prev; in _Py_dec_count()
223 tp->tp_next = tp->tp_prev = NULL; in _Py_dec_count()
224 Py_DECREF(tp); in _Py_dec_count()
254 PyObject_Init(PyObject *op, PyTypeObject *tp) in PyObject_Init() argument
259 Py_TYPE(op) = tp; in PyObject_Init()
260 if (PyType_GetFlags(tp) & Py_TPFLAGS_HEAPTYPE) { in PyObject_Init()
261 Py_INCREF(tp); in PyObject_Init()
268 PyObject_InitVar(PyVarObject *op, PyTypeObject *tp, Py_ssize_t size) in PyObject_InitVar() argument
274 PyObject_Init((PyObject *)op, tp); in PyObject_InitVar()
279 _PyObject_New(PyTypeObject *tp) in _PyObject_New() argument
282 op = (PyObject *) PyObject_MALLOC(_PyObject_SIZE(tp)); in _PyObject_New()
285 return PyObject_INIT(op, tp); in _PyObject_New()
289 _PyObject_NewVar(PyTypeObject *tp, Py_ssize_t nitems) in _PyObject_NewVar() argument
292 const size_t size = _PyObject_VAR_SIZE(tp, nitems); in _PyObject_NewVar()
296 return PyObject_INIT_VAR(op, tp, nitems); in _PyObject_NewVar()
302 PyTypeObject *tp = Py_TYPE(self); in PyObject_CallFinalizer() local
304 if (tp->tp_finalize == NULL) in PyObject_CallFinalizer()
307 if (PyType_IS_GC(tp) && _PyGC_FINALIZED(self)) in PyObject_CallFinalizer()
310 tp->tp_finalize(self); in PyObject_CallFinalizer()
311 if (PyType_IS_GC(tp)) { in PyObject_CallFinalizer()
815 PyTypeObject *tp = Py_TYPE(v); in PyObject_Hash() local
816 if (tp->tp_hash != NULL) in PyObject_Hash()
817 return (*tp->tp_hash)(v); in PyObject_Hash()
823 if (tp->tp_dict == NULL) { in PyObject_Hash()
824 if (PyType_Ready(tp) < 0) in PyObject_Hash()
826 if (tp->tp_hash != NULL) in PyObject_Hash()
827 return (*tp->tp_hash)(v); in PyObject_Hash()
929 PyTypeObject *tp = Py_TYPE(v); in PyObject_GetAttr() local
937 if (tp->tp_getattro != NULL) in PyObject_GetAttr()
938 return (*tp->tp_getattro)(v, name); in PyObject_GetAttr()
939 if (tp->tp_getattr != NULL) { in PyObject_GetAttr()
943 return (*tp->tp_getattr)(v, (char *)name_str); in PyObject_GetAttr()
947 tp->tp_name, name); in PyObject_GetAttr()
954 PyTypeObject *tp = Py_TYPE(v); in _PyObject_LookupAttr() local
964 if (tp->tp_getattro == PyObject_GenericGetAttr) { in _PyObject_LookupAttr()
974 if (tp->tp_getattro != NULL) { in _PyObject_LookupAttr()
975 *result = (*tp->tp_getattro)(v, name); in _PyObject_LookupAttr()
977 else if (tp->tp_getattr != NULL) { in _PyObject_LookupAttr()
983 *result = (*tp->tp_getattr)(v, (char *)name_str); in _PyObject_LookupAttr()
1029 PyTypeObject *tp = Py_TYPE(v); in PyObject_SetAttr() local
1041 if (tp->tp_setattro != NULL) { in PyObject_SetAttr()
1042 err = (*tp->tp_setattro)(v, name, value); in PyObject_SetAttr()
1046 if (tp->tp_setattr != NULL) { in PyObject_SetAttr()
1052 err = (*tp->tp_setattr)(v, (char *)name_str, value); in PyObject_SetAttr()
1058 if (tp->tp_getattr == NULL && tp->tp_getattro == NULL) in PyObject_SetAttr()
1062 tp->tp_name, in PyObject_SetAttr()
1069 tp->tp_name, in PyObject_SetAttr()
1081 PyTypeObject *tp = Py_TYPE(obj); in _PyObject_GetDictPtr() local
1083 dictoffset = tp->tp_dictoffset; in _PyObject_GetDictPtr()
1093 size = _PyObject_VAR_SIZE(tp, tsize); in _PyObject_GetDictPtr()
1137 PyTypeObject *tp = Py_TYPE(obj); in _PyObject_GetMethod() local
1152 if (tp->tp_dict == NULL && PyType_Ready(tp) < 0) in _PyObject_GetMethod()
1155 descr = _PyType_Lookup(tp, name); in _PyObject_GetMethod()
1208 tp->tp_name, name); in _PyObject_GetMethod()
1224 PyTypeObject *tp = Py_TYPE(obj); in _PyObject_GenericGetAttrWithDict() local
1239 if (tp->tp_dict == NULL) { in _PyObject_GenericGetAttrWithDict()
1240 if (PyType_Ready(tp) < 0) in _PyObject_GenericGetAttrWithDict()
1244 descr = _PyType_Lookup(tp, name); in _PyObject_GenericGetAttrWithDict()
1262 dictoffset = tp->tp_dictoffset; in _PyObject_GenericGetAttrWithDict()
1271 size = _PyObject_VAR_SIZE(tp, tsize); in _PyObject_GenericGetAttrWithDict()
1321 tp->tp_name, name); in _PyObject_GenericGetAttrWithDict()
1339 PyTypeObject *tp = Py_TYPE(obj); in _PyObject_GenericSetAttrWithDict() local
1352 if (tp->tp_dict == NULL && PyType_Ready(tp) < 0) in _PyObject_GenericSetAttrWithDict()
1357 descr = _PyType_Lookup(tp, name); in _PyObject_GenericSetAttrWithDict()
1382 tp->tp_name, name); in _PyObject_GenericSetAttrWithDict()
1387 tp->tp_name, name); in _PyObject_GenericSetAttrWithDict()
1391 res = _PyObjectDict_SetItem(tp, dictptr, name, value); in _PyObject_GenericSetAttrWithDict()