Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(493)

Unified Diff: third_party/cython/src/Cython/Utility/ExtensionTypes.c

Issue 385073004: Adding cython v0.20.2 in third-party. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reference cython dev list thread. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/cython/src/Cython/Utility/ExtensionTypes.c
diff --git a/third_party/cython/src/Cython/Utility/ExtensionTypes.c b/third_party/cython/src/Cython/Utility/ExtensionTypes.c
new file mode 100644
index 0000000000000000000000000000000000000000..423ed9673259123a9d16b5c55708e02d03bd4ebb
--- /dev/null
+++ b/third_party/cython/src/Cython/Utility/ExtensionTypes.c
@@ -0,0 +1,53 @@
+
+/////////////// CallNextTpDealloc.proto ///////////////
+
+static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc);
+
+/////////////// CallNextTpDealloc ///////////////
+
+static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) {
+ PyTypeObject* type = Py_TYPE(obj);
+ /* try to find the first parent type that has a different tp_dealloc() function */
+ while (type && type->tp_dealloc != current_tp_dealloc)
+ type = type->tp_base;
+ while (type && type->tp_dealloc == current_tp_dealloc)
+ type = type->tp_base;
+ if (type)
+ type->tp_dealloc(obj);
+}
+
+/////////////// CallNextTpTraverse.proto ///////////////
+
+static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);
+
+/////////////// CallNextTpTraverse ///////////////
+
+static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
+ PyTypeObject* type = Py_TYPE(obj);
+ /* try to find the first parent type that has a different tp_traverse() function */
+ while (type && type->tp_traverse != current_tp_traverse)
+ type = type->tp_base;
+ while (type && type->tp_traverse == current_tp_traverse)
+ type = type->tp_base;
+ if (type && type->tp_traverse)
+ return type->tp_traverse(obj, v, a);
+ // FIXME: really ignore?
+ return 0;
+}
+
+/////////////// CallNextTpClear.proto ///////////////
+
+static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);
+
+/////////////// CallNextTpClear ///////////////
+
+static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
+ PyTypeObject* type = Py_TYPE(obj);
+ /* try to find the first parent type that has a different tp_clear() function */
+ while (type && type->tp_clear != current_tp_clear)
+ type = type->tp_base;
+ while (type && type->tp_clear == current_tp_clear)
+ type = type->tp_base;
+ if (type && type->tp_clear)
+ type->tp_clear(obj);
+}
« no previous file with comments | « third_party/cython/src/Cython/Utility/Exceptions.c ('k') | third_party/cython/src/Cython/Utility/FunctionArguments.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698