Lines Matching refs:state

28     void *state = _PyModule_GetState(module);
29 assert(state != NULL);
30 return (_functools_state *)state;
420 partial_setstate(partialobject *pto, PyObject *state)
424 if (!PyTuple_Check(state) ||
425 !PyArg_ParseTuple(state, "OOOO", &fn, &fnargs, &kw, &dict) ||
430 PyErr_SetString(PyExc_TypeError, "invalid partial state");
634 _functools_state *state;
639 state = get_functools_state(self);
640 object = PyObject_GC_New(keyobject, state->keyobject_type);
972 Accordingly, we have make sure not modify the cache state prior to
982 state modifications (dict access #2) or be prepared to restore
988 so that we know the cache is a consistent state.
1105 cache in an inconsistent state, we don't restore the link. */
1164 _functools_state *state;
1180 state = get_functools_state_by_type(type);
1181 if (state == NULL) {
1224 Py_INCREF(state->kwd_mark);
1225 obj->kwd_mark = state->kwd_mark;
1226 Py_INCREF(state->lru_list_elem_type);
1227 obj->lru_list_elem_type = state->lru_list_elem_type;
1443 _functools_state *state = get_functools_state(module);
1444 state->kwd_mark = _PyObject_CallNoArgs((PyObject *)&PyBaseObject_Type);
1445 if (state->kwd_mark == NULL) {
1449 state->partial_type = (PyTypeObject *)PyType_FromModuleAndSpec(module,
1451 if (state->partial_type == NULL) {
1454 if (PyModule_AddType(module, state->partial_type) < 0) {
1469 state->keyobject_type = (PyTypeObject *)PyType_FromModuleAndSpec(module,
1471 if (state->keyobject_type == NULL) {
1477 state->lru_list_elem_type = (PyTypeObject *)PyType_FromModuleAndSpec(
1479 if (state->lru_list_elem_type == NULL) {
1491 _functools_state *state = get_functools_state(module);
1492 Py_VISIT(state->kwd_mark);
1493 Py_VISIT(state->partial_type);
1494 Py_VISIT(state->keyobject_type);
1495 Py_VISIT(state->lru_list_elem_type);
1502 _functools_state *state = get_functools_state(module);
1503 Py_CLEAR(state->kwd_mark);
1504 Py_CLEAR(state->partial_type);
1505 Py_CLEAR(state->keyobject_type);
1506 Py_CLEAR(state->lru_list_elem_type);