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
73e89124
Commit
73e89124
authored
Mar 17, 2016
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
generally #define PyObject_Malloc() and friends to their PyMem_*() counterparts in PyPy
parent
8657bc27
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
+6
-8
Cython/Utility/CythonFunction.c
Cython/Utility/CythonFunction.c
+0
-8
Cython/Utility/ModuleSetupCode.c
Cython/Utility/ModuleSetupCode.c
+6
-0
No files found.
Cython/Utility/CythonFunction.c
View file @
73e89124
...
...
@@ -498,11 +498,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
for
(
i
=
0
;
i
<
m
->
defaults_pyobjects
;
i
++
)
Py_XDECREF
(
pydefaults
[
i
]);
#if CYTHON_COMPILING_IN_CPYTHON
PyObject_Free
(
m
->
defaults
);
#else
PyMem_Free
(
m
->
defaults
);
#endif
m
->
defaults
=
NULL
;
}
...
...
@@ -712,11 +708,7 @@ static int __pyx_CyFunction_init(void) {
static
CYTHON_INLINE
void
*
__Pyx_CyFunction_InitDefaults
(
PyObject
*
func
,
size_t
size
,
int
pyobjects
)
{
__pyx_CyFunctionObject
*
m
=
(
__pyx_CyFunctionObject
*
)
func
;
#if CYTHON_COMPILING_IN_CPYTHON
m
->
defaults
=
PyObject_Malloc
(
size
);
#else
m
->
defaults
=
PyMem_Malloc
(
size
);
#endif
if
(
!
m
->
defaults
)
return
PyErr_NoMemory
();
memset
(
m
->
defaults
,
0
,
size
);
...
...
Cython/Utility/ModuleSetupCode.c
View file @
73e89124
...
...
@@ -117,6 +117,12 @@
#define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
#define PyObject_Malloc(s) PyMem_Malloc(s)
#define PyObject_Free(p) PyMem_Free(p)
#define PyObject_Realloc(p) PyMem_Realloc(p)
#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))
...
...
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