Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
3bd1c068
Commit
3bd1c068
authored
Nov 12, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import gcmodule.c and genobject.h
parent
b528ca09
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
18 deletions
+53
-18
CMakeLists.txt
CMakeLists.txt
+1
-1
from_cpython/CMakeLists.txt
from_cpython/CMakeLists.txt
+1
-0
from_cpython/Include/Python.h
from_cpython/Include/Python.h
+1
-0
from_cpython/Include/genobject.h
from_cpython/Include/genobject.h
+48
-0
from_cpython/Include/objimpl.h
from_cpython/Include/objimpl.h
+1
-16
from_cpython/Modules/gcmodule.c
from_cpython/Modules/gcmodule.c
+1
-1
No files found.
CMakeLists.txt
View file @
3bd1c068
...
...
@@ -377,4 +377,4 @@ install(FILES test/lib/virtualenv/virtualenv_support/setuptools-12.0.5-py2.py3-n
include
(
CPack
)
# last file added (need to change this if we add a file that is added via a glob):
# from_cpython/
Lib/test/test_zipimport.py
# from_cpython/
Include/genobject.h
from_cpython/CMakeLists.txt
View file @
3bd1c068
...
...
@@ -44,6 +44,7 @@ file(GLOB_RECURSE STDMODULE_SRCS Modules
fcntlmodule.c
fileio.c
future_builtins.c
gcmodule.c
getpath.c
iobase.c
itertoolsmodule.c
...
...
from_cpython/Include/Python.h
View file @
3bd1c068
...
...
@@ -82,6 +82,7 @@
#include "traceback.h"
#include "sliceobject.h"
#include "iterobject.h"
#include "genobject.h"
#include "descrobject.h"
#include "warnings.h"
#include "weakrefobject.h"
...
...
from_cpython/Include/genobject.h
0 → 100644
View file @
3bd1c068
// This file is originally from CPython 2.7, with modifications for Pyston
/* Generator object interface */
#ifndef Py_GENOBJECT_H
#define Py_GENOBJECT_H
#ifdef __cplusplus
extern
"C"
{
#endif
struct
_frame
;
/* Avoid including frameobject.h */
// Pyston change: this is not our object format
#if 0
typedef struct {
PyObject_HEAD
/* The gi_ prefix is intended to remind of generator-iterator. */
/* Note: gi_frame can be NULL if the generator is "finished" */
struct _frame *gi_frame;
/* True if generator is being executed. */
int gi_running;
/* The code object backing the generator */
PyObject *gi_code;
/* List of weak reference. */
PyObject *gi_weakreflist;
} PyGenObject;
#endif
typedef
struct
_PyGenObject
PyGenObject
;
// Pyston change: not a static object
//PyAPI_DATA(PyTypeObject) PyGen_Type;
PyAPI_DATA
(
PyTypeObject
*
)
generator_cls
;
#define PyGen_Type (*generator_cls)
#define PyGen_Check(op) PyObject_TypeCheck(op, &PyGen_Type)
#define PyGen_CheckExact(op) (Py_TYPE(op) == &PyGen_Type)
PyAPI_FUNC
(
PyObject
*
)
PyGen_New
(
struct
_frame
*
);
PyAPI_FUNC
(
int
)
PyGen_NeedsFinalizing
(
PyGenObject
*
);
#ifdef __cplusplus
}
#endif
#endif
/* !Py_GENOBJECT_H */
from_cpython/Include/objimpl.h
View file @
3bd1c068
...
...
@@ -241,9 +241,6 @@ PyAPI_FUNC(PyVarObject *) _PyObject_NewVar(PyTypeObject *, Py_ssize_t) PYSTON_NO
/* C equivalent of gc.collect(). */
PyAPI_FUNC
(
Py_ssize_t
)
PyGC_Collect
(
void
)
PYSTON_NOEXCEPT
;
// Pyston changes: everything is GC tracked now
#if 0
/* Test if a type has a GC head */
#define PyType_IS_GC(t) PyType_HasFeature((t), Py_TPFLAGS_HAVE_GC)
...
...
@@ -311,10 +308,7 @@ extern PyGC_Head *_PyGC_generation0;
#define _PyObject_GC_MAY_BE_TRACKED(obj) \
(PyObject_IS_GC(obj) && \
(!PyTuple_CheckExact(obj) || _PyObject_GC_IS_TRACKED(obj)))
#else
/* for source compatibility with 2.2 */
#define _PyObject_GC_Del PyObject_GC_Del
#endif
PyAPI_FUNC
(
PyObject
*
)
_PyObject_GC_Malloc
(
size_t
)
PYSTON_NOEXCEPT
;
PyAPI_FUNC
(
PyObject
*
)
_PyObject_GC_New
(
PyTypeObject
*
)
PYSTON_NOEXCEPT
;
...
...
@@ -322,15 +316,6 @@ PyAPI_FUNC(PyVarObject *) _PyObject_GC_NewVar(PyTypeObject *, Py_ssize_t) PYSTON
PyAPI_FUNC
(
void
)
PyObject_GC_Track
(
void
*
)
PYSTON_NOEXCEPT
;
PyAPI_FUNC
(
void
)
PyObject_GC_UnTrack
(
void
*
)
PYSTON_NOEXCEPT
;
PyAPI_FUNC
(
void
)
PyObject_GC_Del
(
void
*
)
PYSTON_NOEXCEPT
;
#define PyType_IS_GC(t) ((t),1)
#define _PyObject_GC_TRACK(o) ((void)(o))
#define _PyObject_GC_UNTRACK(o) ((void)(o))
#define _PyObject_GC_Malloc(size) ((PyObject*)PyObject_MALLOC(size))
#define _PyObject_GC_New _PyObject_New
#define PyObject_GC_Track(o) ((void)(o))
#define PyObject_GC_UnTrack(o) ((void)(o))
#define PyObject_GC_Del PyObject_Del
#define PyObject_GC_New(type, typeobj) \
( (type *) _PyObject_GC_New(typeobj) )
...
...
from_cpython/Modules/gcmodule.c
View file @
3bd1c068
...
...
@@ -19,7 +19,7 @@
*/
#include "Python.h"
#include "frameobject.h"
/* for PyFrame_ClearFreeList */
//
#include "frameobject.h" /* for PyFrame_ClearFreeList */
/* Get an object's GC head */
#define AS_GC(o) ((PyGC_Head *)(o)-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