• Home
  • Raw
  • Download

Lines Matching refs:modstate

41 atexit_delete_cb(atexitmodule_state *modstate, int i)  in atexit_delete_cb()  argument
45 cb = modstate->atexit_callbacks[i]; in atexit_delete_cb()
46 modstate->atexit_callbacks[i] = NULL; in atexit_delete_cb()
55 atexit_cleanup(atexitmodule_state *modstate) in atexit_cleanup() argument
59 for (i = 0; i < modstate->ncallbacks; i++) { in atexit_cleanup()
60 cb = modstate->atexit_callbacks[i]; in atexit_cleanup()
64 atexit_delete_cb(modstate, i); in atexit_cleanup()
66 modstate->ncallbacks = 0; in atexit_cleanup()
76 atexitmodule_state *modstate; in atexit_callfuncs() local
81 modstate = get_atexit_state(module); in atexit_callfuncs()
83 if (modstate->ncallbacks == 0) in atexit_callfuncs()
87 for (i = modstate->ncallbacks - 1; i >= 0; i--) in atexit_callfuncs()
89 cb = modstate->atexit_callbacks[i]; in atexit_callfuncs()
112 atexit_cleanup(modstate); in atexit_callfuncs()
135 atexitmodule_state *modstate; in atexit_register() local
139 modstate = get_atexit_state(self); in atexit_register()
141 if (modstate->ncallbacks >= modstate->callback_len) { in atexit_register()
143 modstate->callback_len += 16; in atexit_register()
144 r = (atexit_callback**)PyMem_Realloc(modstate->atexit_callbacks, in atexit_register()
145 sizeof(atexit_callback*) * modstate->callback_len); in atexit_register()
148 modstate->atexit_callbacks = r; in atexit_register()
178 modstate->atexit_callbacks[modstate->ncallbacks++] = new_callback; in atexit_register()
218 atexitmodule_state *modstate; in atexit_ncallbacks() local
220 modstate = get_atexit_state(self); in atexit_ncallbacks()
222 return PyLong_FromSsize_t(modstate->ncallbacks); in atexit_ncallbacks()
229 atexitmodule_state *modstate; in atexit_m_traverse() local
231 modstate = (atexitmodule_state *)PyModule_GetState(self); in atexit_m_traverse()
233 for (i = 0; i < modstate->ncallbacks; i++) { in atexit_m_traverse()
234 atexit_callback *cb = modstate->atexit_callbacks[i]; in atexit_m_traverse()
247 atexitmodule_state *modstate; in atexit_m_clear() local
248 modstate = (atexitmodule_state *)PyModule_GetState(self); in atexit_m_clear()
249 atexit_cleanup(modstate); in atexit_m_clear()
256 atexitmodule_state *modstate; in atexit_free() local
257 modstate = (atexitmodule_state *)PyModule_GetState(m); in atexit_free()
258 atexit_cleanup(modstate); in atexit_free()
259 PyMem_Free(modstate->atexit_callbacks); in atexit_free()
273 atexitmodule_state *modstate; in atexit_unregister() local
277 modstate = get_atexit_state(self); in atexit_unregister()
279 for (i = 0; i < modstate->ncallbacks; i++) in atexit_unregister()
281 cb = modstate->atexit_callbacks[i]; in atexit_unregister()
289 atexit_delete_cb(modstate, i); in atexit_unregister()
320 atexitmodule_state *modstate; in atexit_exec() local
322 modstate = get_atexit_state(m); in atexit_exec()
323 modstate->callback_len = 32; in atexit_exec()
324 modstate->ncallbacks = 0; in atexit_exec()
325 modstate->atexit_callbacks = PyMem_New(atexit_callback*, in atexit_exec()
326 modstate->callback_len); in atexit_exec()
327 if (modstate->atexit_callbacks == NULL) in atexit_exec()