Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
bc1a0d42
Commit
bc1a0d42
authored
5 years ago
by
Jeroen Demeyer
Committed by
Stefan Behnel
5 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Put __Pyx_PyMethod_New directly in the tp_descr_get slot (GH-3116)
Minor cleanup regarding __Pyx_PyMethod_New
parent
81680637
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
13 deletions
+19
-13
Cython/Utility/CythonFunction.c
Cython/Utility/CythonFunction.c
+2
-7
Cython/Utility/ModuleSetupCode.c
Cython/Utility/ModuleSetupCode.c
+0
-6
Cython/Utility/ObjectHandling.c
Cython/Utility/ObjectHandling.c
+17
-0
No files found.
Cython/Utility/CythonFunction.c
View file @
bc1a0d42
...
@@ -74,7 +74,7 @@ static int __pyx_CyFunction_init(void);
...
@@ -74,7 +74,7 @@ static int __pyx_CyFunction_init(void);
//////////////////// CythonFunction ////////////////////
//////////////////// CythonFunction ////////////////////
//@substitute: naming
//@substitute: naming
//@requires: CommonStructures.c::FetchCommonType
//@requires: CommonStructures.c::FetchCommonType
//
//@requires: ObjectHandling.c::PyObjectGetAttrStr
//
@requires: ObjectHandling.c::PyMethodNew
#include <structmember.h>
#include <structmember.h>
...
@@ -550,11 +550,6 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit,
...
@@ -550,11 +550,6 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit,
return
0
;
return
0
;
}
}
static
PyObject
*
__Pyx_CyFunction_descr_get
(
PyObject
*
func
,
PyObject
*
obj
,
PyObject
*
type
)
{
return
__Pyx_PyMethod_New
(
func
,
obj
,
type
);
}
static
PyObject
*
static
PyObject
*
__Pyx_CyFunction_repr
(
__pyx_CyFunctionObject
*
op
)
__Pyx_CyFunction_repr
(
__pyx_CyFunctionObject
*
op
)
{
{
...
@@ -701,7 +696,7 @@ static PyTypeObject __pyx_CyFunctionType_type = {
...
@@ -701,7 +696,7 @@ static PyTypeObject __pyx_CyFunctionType_type = {
__pyx_CyFunction_getsets
,
/*tp_getset*/
__pyx_CyFunction_getsets
,
/*tp_getset*/
0
,
/*tp_base*/
0
,
/*tp_base*/
0
,
/*tp_dict*/
0
,
/*tp_dict*/
__Pyx_
CyFunction_descr_get
,
/*tp_descr_get*/
__Pyx_
PyMethod_New
,
/*tp_descr_get*/
0
,
/*tp_descr_set*/
0
,
/*tp_descr_set*/
offsetof
(
__pyx_CyFunctionObject
,
func_dict
),
/*tp_dictoffset*/
offsetof
(
__pyx_CyFunctionObject
,
func_dict
),
/*tp_dictoffset*/
0
,
/*tp_init*/
0
,
/*tp_init*/
...
...
This diff is collapsed.
Click to expand it.
Cython/Utility/ModuleSetupCode.c
View file @
bc1a0d42
...
@@ -705,12 +705,6 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict,
...
@@ -705,12 +705,6 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict,
#define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
#define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
#endif
#endif
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
#else
#define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
// backport of PyAsyncMethods from Py3.5 to older Py3.x versions
// backport of PyAsyncMethods from Py3.5 to older Py3.x versions
// (mis-)using the "tp_reserved" type slot which is re-activated as "tp_as_async" in Py3.5
// (mis-)using the "tp_reserved" type slot which is re-activated as "tp_as_async" in Py3.5
#if CYTHON_USE_ASYNC_SLOTS
#if CYTHON_USE_ASYNC_SLOTS
...
...
This diff is collapsed.
Click to expand it.
Cython/Utility/ObjectHandling.c
View file @
bc1a0d42
...
@@ -2446,3 +2446,20 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN
...
@@ -2446,3 +2446,20 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN
return
obj_dict_version
==
__Pyx_get_object_dict_version
(
obj
);
return
obj_dict_version
==
__Pyx_get_object_dict_version
(
obj
);
}
}
#endif
#endif
/////////////// PyMethodNew.proto ///////////////
#if PY_MAJOR_VERSION >= 3
// This should be an actual function (not a macro), such that we can put it
// directly in a tp_descr_get slot.
static
PyObject
*
__Pyx_PyMethod_New
(
PyObject
*
func
,
PyObject
*
self
,
CYTHON_UNUSED
PyObject
*
typ
)
{
if
(
!
self
)
{
Py_INCREF
(
func
);
return
func
;
}
return
PyMethod_New
(
func
,
self
);
}
#else
#define __Pyx_PyMethod_New PyMethod_New
#endif
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment