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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
09485f95
Commit
09485f95
authored
Aug 16, 2016
by
scoder
Committed by
GitHub
Aug 16, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #528 from Daetalus/pyston_changes
Initial Cython patch for Pyston.
parents
499d2622
9a02e1ca
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
6 deletions
+44
-6
Cython/Utility/Coroutine.c
Cython/Utility/Coroutine.c
+3
-3
Cython/Utility/CythonFunction.c
Cython/Utility/CythonFunction.c
+5
-0
Cython/Utility/ModuleSetupCode.c
Cython/Utility/ModuleSetupCode.c
+35
-2
Cython/Utility/Profile.c
Cython/Utility/Profile.c
+1
-1
No files found.
Cython/Utility/Coroutine.c
View file @
09485f95
...
...
@@ -553,7 +553,7 @@ PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value) {
__Pyx_PyThreadState_assign
if
(
value
)
{
#if CYTHON_COMPILING_IN_PYPY
#if CYTHON_COMPILING_IN_PYPY
|| CYTHON_COMPILING_IN_PYSTON
// FIXME: what to do in PyPy?
#else
// Generators always return to their most recent caller, not
...
...
@@ -580,7 +580,7 @@ PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value) {
if
(
retval
)
{
__Pyx_ExceptionSwap
(
&
self
->
exc_type
,
&
self
->
exc_value
,
&
self
->
exc_traceback
);
#if CYTHON_COMPILING_IN_PYPY
#if CYTHON_COMPILING_IN_PYPY
|| CYTHON_COMPILING_IN_PYSTON
// FIXME: what to do in PyPy?
#else
// Don't keep the reference to f_back any longer than necessary. It
...
...
@@ -1486,7 +1486,7 @@ static void __Pyx__ReturnWithStopIteration(PyObject* value); /*proto*/
static
void
__Pyx__ReturnWithStopIteration
(
PyObject
*
value
)
{
PyObject
*
exc
,
*
args
;
#if CYTHON_COMPILING_IN_
CPYTH
ON
#if CYTHON_COMPILING_IN_
PYPY || CYTHON_COMPILING_IN_PYST
ON
__Pyx_PyThreadState_declare
if
((
PY_VERSION_HEX
>=
0x03030000
&&
PY_VERSION_HEX
<
0x030500B1
)
||
unlikely
(
PyTuple_Check
(
value
)))
{
args
=
PyTuple_New
(
1
);
...
...
Cython/Utility/CythonFunction.c
View file @
09485f95
...
...
@@ -1200,6 +1200,10 @@ static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
// cdef classes
return
PyClassMethod_New
(
method
);
}
#else
#if CYTHON_COMPILING_IN_PYSTON
// Pyston add this API for convinience.
if
(
PyMethodDescr_Check
(
method
))
{
#else
// It appears that PyMethodDescr_Type is not anywhere exposed in the Python/C API
static
PyTypeObject
*
methoddescr_type
=
NULL
;
...
...
@@ -1210,6 +1214,7 @@ static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
Py_DECREF
(
meth
);
}
if
(
PyObject_TypeCheck
(
method
,
methoddescr_type
))
{
#endif
// cdef classes
PyMethodDescrObject
*
descr
=
(
PyMethodDescrObject
*
)
method
;
#if PY_VERSION_HEX < 0x03020000
...
...
Cython/Utility/ModuleSetupCode.c
View file @
09485f95
...
...
@@ -53,6 +53,33 @@
#define CYTHON_UNPACK_METHODS 0
#undef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 0
#elif defined(PYSTON_VERSION)
#define CYTHON_COMPILING_IN_PYSTON 1
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 0
#ifndef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 1
#endif
#undef CYTHON_USE_ASYNC_SLOTS
#define CYTHON_USE_ASYNC_SLOTS 0
#undef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 0
#ifndef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 1
#endif
#undef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 0
#ifndef CYTHON_AVOID_BORROWED_REFS
#define CYTHON_AVOID_BORROWED_REFS 0
#endif
#ifndef CYTHON_ASSUME_SAFE_MACROS
#define CYTHON_ASSUME_SAFE_MACROS 1
#endif
#ifndef CYTHON_UNPACK_METHODS
#define CYTHON_UNPACK_METHODS 1
#endif
#undef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 1
...
...
@@ -186,8 +213,14 @@
#define PyObject_Realloc(p) PyMem_Realloc(p)
#endif
#define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
#define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
/* Pyston provided out off box */
#if !CYTHON_COMPILING_IN_PYSTON
#define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
#define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
#else
#define __Pyx_PyCode_HasFreeVars PyCode_HasFreeVars
#define __Pyx_PyFrame_SetLineNumber PyFrame_SetLineNumber
#endif
#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
...
...
Cython/Utility/Profile.c
View file @
09485f95
...
...
@@ -5,7 +5,7 @@
// but maybe some other profilers don't.
#ifndef CYTHON_PROFILE
#if CYTHON_COMPILING_IN_PYPY
#if CYTHON_COMPILING_IN_PYPY
|| CYTHON_COMPILING_IN_PYSTON
#define CYTHON_PROFILE 0
#else
#define CYTHON_PROFILE 1
...
...
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