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
7ae5501a
Commit
7ae5501a
authored
Nov 03, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
it begins
parent
cb5df340
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
16 deletions
+18
-16
from_cpython/Include/object.h
from_cpython/Include/object.h
+18
-16
No files found.
from_cpython/Include/object.h
View file @
7ae5501a
...
...
@@ -79,15 +79,14 @@ whose size is determined when the object is allocated.
#endif
/* PyObject_HEAD defines the initial segment of every PyObject. */
// Pyston change: removed ob_refcnt
#define PyObject_HEAD \
_PyObject_HEAD_EXTRA \
Py_ssize_t ob_refcnt; \
struct _typeobject *ob_type;
// Pyston change: removed '1', the initial refcount
#define PyObject_HEAD_INIT(type) \
_PyObject_EXTRA_INIT \
type,
1,
type,
#define PyVarObject_HEAD_INIT(type, size) \
PyObject_HEAD_INIT(type) size,
...
...
@@ -131,7 +130,8 @@ typedef pyston::BoxVar PyVarObject;
#define Py_TYPE(ob) ((ob)->cls)
#endif
// Pyston change: removed Py_REFCNT, moved Py_TYPE to above
// Pyston change: moved Py_TYPE to above
#define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
#define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
/*
...
...
@@ -814,16 +814,10 @@ PyAPI_FUNC(void) _Py_AddToAllObjects(PyObject *, int force) PYSTON_NOEXCEPT;
/* Without Py_TRACE_REFS, there's little enough to do that we expand code
* inline.
*/
/* Pyston change: we don't have a refcount
#define _Py_NewReference(op) ( \
_Py_INC_TPALLOCS(op) _Py_COUNT_ALLOCS_COMMA \
_Py_INC_REFTOTAL _Py_REF_DEBUG_COMMA \
Py_REFCNT(op) = 1)
*/
#define _Py_NewReference(op) ( \
_Py_INC_TPALLOCS(op) _Py_COUNT_ALLOCS_COMMA \
_Py_INC_REFTOTAL _Py_REF_DEBUG_COMMA \
(void)(op))
#define _Py_ForgetReference(op) _Py_INC_TPFREES(op)
...
...
@@ -832,9 +826,18 @@ PyAPI_FUNC(void) _Py_AddToAllObjects(PyObject *, int force) PYSTON_NOEXCEPT;
(*Py_TYPE(op)->tp_dealloc)((PyObject *)(op)))
#endif
/* !Py_TRACE_REFS */
#define Py_INCREF(op) ((void)(op))
#define Py_DECREF(op) __asm volatile("" : : "X"(op))
#define Py_INCREF(op) ( \
_Py_INC_REFTOTAL _Py_REF_DEBUG_COMMA \
((PyObject*)(op))->ob_refcnt++)
#define Py_DECREF(op) \
do { \
if (_Py_DEC_REFTOTAL _Py_REF_DEBUG_COMMA \
--((PyObject*)(op))->ob_refcnt != 0) \
_Py_CHECK_REFCNT(op) \
else \
_Py_Dealloc((PyObject *)(op)); \
} while (0)
/* Safely decref `op` and set `op` to NULL, especially useful in tp_clear
* and tp_dealloc implementatons.
...
...
@@ -880,9 +883,8 @@ PyAPI_FUNC(void) _Py_AddToAllObjects(PyObject *, int force) PYSTON_NOEXCEPT;
} while (0)
/* Macros to use in case the object pointer may be NULL: */
// Pyston change: made these noops as well
#define Py_XINCREF(op) ((void)(op))
#define Py_XDECREF(op) __asm volatile("" : : "X"(op))
#define Py_XINCREF(op) do { if ((op) == NULL) ; else Py_INCREF(op); } while (0)
#define Py_XDECREF(op) do { if ((op) == NULL) ; else Py_DECREF(op); } while (0)
/*
These are provided as conveniences to Python runtime embedders, so that
...
...
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