Skip to content

Commit

Permalink
Remove Ci_TypeRaisingCallback/Ci_hook_type_pre_setattr
Browse files Browse the repository at this point in the history
Summary: We now add a dictionary watcher for listening to changes to a type's dictionary, and when they occur, we initialize the type for patching.

Reviewed By: alexmalyshev

Differential Revision: D60084797

fbshipit-source-id: af389864b4690eca6e6bde92d13f8b79e77ad44a
  • Loading branch information
DinoV authored and facebook-github-bot committed Aug 1, 2024
1 parent be270be commit f69e407
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 7 deletions.
3 changes: 0 additions & 3 deletions Include/cinder/hooks.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ CiAPI_DATA(Ci_HookType_ShadowFrame_WalkAndPopulate)
Ci_hook_ShadowFrame_WalkAndPopulate;

/* Hooks for Static Python. */
typedef int(*Ci_TypeRaisingCallback)(PyTypeObject *type);
CiAPI_DATA(Ci_TypeRaisingCallback) Ci_hook_type_pre_setattr;

typedef int(*Ci_TypeAttrRaisingCallback)(PyTypeObject *type, PyObject *name, PyObject *value);
CiAPI_DATA(Ci_TypeAttrRaisingCallback) Ci_hook_type_setattr;

Expand Down
3 changes: 0 additions & 3 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -4398,9 +4398,6 @@ type_setattro(PyTypeObject *type, PyObject *name, PyObject *value)
existing = PyDict_GetItem(type->tp_dict, name);
Py_XINCREF(existing);
}
if (Ci_hook_type_pre_setattr) {
Ci_hook_type_pre_setattr(type);
}
res = _PyObject_GenericSetAttrWithDict((PyObject *)type, name, value, NULL);
if (res == 0) {
/* Clear the VALID_VERSION flag of 'type' and all its
Expand Down
1 change: 0 additions & 1 deletion Python/cinderhooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Ci_HookType_ShadowFrame_GetModuleName_JIT Ci_hook_ShadowFrame_GetModuleName_JIT
Ci_HookType_ShadowFrame_WalkAndPopulate Ci_hook_ShadowFrame_WalkAndPopulate = NULL;

/* Static Python. */
Ci_TypeRaisingCallback Ci_hook_type_pre_setattr = NULL;
Ci_TypeAttrRaisingCallback Ci_hook_type_setattr = NULL;
Ci_HookType_PyCMethod_New Ci_hook_PyCMethod_New = NULL;
Ci_HookType_PyDescr_NewMethod Ci_hook_PyDescr_NewMethod = NULL;
Expand Down

0 comments on commit f69e407

Please sign in to comment.