Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(65)

Delta Between Two Patch Sets: Objects/weakrefobject.c

Issue 29259: Add tp_fastcall to PyTypeObject: support FASTCALL calling convention for all callable objects
Left Patch Set: Created 3 years ago
Right Patch Set: Created 2 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
1 #include "Python.h" 1 #include "Python.h"
2 #include "structmember.h" 2 #include "structmember.h"
3 3
4 4
5 #define GET_WEAKREFS_LISTPTR(o) \ 5 #define GET_WEAKREFS_LISTPTR(o) \
6 ((PyWeakReference **) PyObject_GET_WEAKREFS_LISTPTR(o)) 6 ((PyWeakReference **) PyObject_GET_WEAKREFS_LISTPTR(o))
7 7
8 8
9 Py_ssize_t 9 Py_ssize_t
10 _PyWeakref_GetWeakrefCount(PyWeakReference *head) 10 _PyWeakref_GetWeakrefCount(PyWeakReference *head)
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 (unaryfunc)proxy_repr, /* tp_repr */ 717 (unaryfunc)proxy_repr, /* tp_repr */
718 &proxy_as_number, /* tp_as_number */ 718 &proxy_as_number, /* tp_as_number */
719 &proxy_as_sequence, /* tp_as_sequence */ 719 &proxy_as_sequence, /* tp_as_sequence */
720 &proxy_as_mapping, /* tp_as_mapping */ 720 &proxy_as_mapping, /* tp_as_mapping */
721 0, /* tp_hash */ 721 0, /* tp_hash */
722 0, /* tp_call */ 722 0, /* tp_call */
723 proxy_str, /* tp_str */ 723 proxy_str, /* tp_str */
724 proxy_getattr, /* tp_getattro */ 724 proxy_getattr, /* tp_getattro */
725 (setattrofunc)proxy_setattr, /* tp_setattro */ 725 (setattrofunc)proxy_setattr, /* tp_setattro */
726 0, /* tp_as_buffer */ 726 0, /* tp_as_buffer */
727 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC 727 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags */
728 | Py_TPFLAGS_HAVE_FASTCALL, /* tp_flags */
729 0, /* tp_doc */ 728 0, /* tp_doc */
730 (traverseproc)gc_traverse, /* tp_traverse */ 729 (traverseproc)gc_traverse, /* tp_traverse */
731 (inquiry)gc_clear, /* tp_clear */ 730 (inquiry)gc_clear, /* tp_clear */
732 proxy_richcompare, /* tp_richcompare */ 731 proxy_richcompare, /* tp_richcompare */
733 0, /* tp_weaklistoffset */ 732 0, /* tp_weaklistoffset */
734 (getiterfunc)proxy_iter, /* tp_iter */ 733 (getiterfunc)proxy_iter, /* tp_iter */
735 (iternextfunc)proxy_iternext, /* tp_iternext */ 734 (iternextfunc)proxy_iternext, /* tp_iternext */
736 0, /* tp_methods */ 735
737 0, /* tp_members */ 736 .tp_fastcall = (fastternaryfunc)proxy_call,
738 0, /* tp_getset */
739 0, /* tp_base */
740 0, /* tp_dict */
741 0, /* tp_descr_get */
742 0, /* tp_descr_set */
743 0, /* tp_dictoffset */
744 0, /* tp_init */
745 0, /* tp_alloc */
746 0, /* tp_new */
747 0, /* tp_free */
748 0, /* tp_is_gc */
749 0, /* tp_bases */
750 0, /* tp_mro */
751 0, /* tp_cache */
752 0, /* tp_subclasses */
753 0, /* tp_weaklist */
754 0, /* tp_del */
755 0, /* tp_version_tag */
756 0, /* tp_finalize */
757 (fastternaryfunc)proxy_call, /* tp_fastcall */
758 }; 737 };
759 738
760 739
761 740
762 PyObject * 741 PyObject *
763 PyWeakref_NewRef(PyObject *ob, PyObject *callback) 742 PyWeakref_NewRef(PyObject *ob, PyObject *callback)
764 { 743 {
765 PyWeakReference *result = NULL; 744 PyWeakReference *result = NULL;
766 PyWeakReference **list; 745 PyWeakReference **list;
767 PyWeakReference *ref, *proxy; 746 PyWeakReference *ref, *proxy;
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 PyObject *item = PyTuple_GET_ITEM(tuple, i * 2); 960 PyObject *item = PyTuple_GET_ITEM(tuple, i * 2);
982 handle_callback((PyWeakReference *)item, callback); 961 handle_callback((PyWeakReference *)item, callback);
983 } 962 }
984 } 963 }
985 Py_DECREF(tuple); 964 Py_DECREF(tuple);
986 } 965 }
987 assert(!PyErr_Occurred()); 966 assert(!PyErr_Occurred());
988 PyErr_Restore(err_type, err_value, err_tb); 967 PyErr_Restore(err_type, err_value, err_tb);
989 } 968 }
990 } 969 }
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+