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
0be24aec
Commit
0be24aec
authored
Aug 31, 2016
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code type: do not use GC (same as cpython)
parent
e432e29c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
14 deletions
+3
-14
src/runtime/code.cpp
src/runtime/code.cpp
+2
-12
src/runtime/code.h
src/runtime/code.h
+1
-2
No files found.
src/runtime/code.cpp
View file @
0be24aec
...
@@ -100,18 +100,9 @@ Box* BoxedCode::flags(Box* b, void*) noexcept {
...
@@ -100,18 +100,9 @@ Box* BoxedCode::flags(Box* b, void*) noexcept {
return
boxInt
(
flags
);
return
boxInt
(
flags
);
}
}
int
BoxedCode
::
traverse
(
Box
*
self
,
visitproc
visit
,
void
*
arg
)
noexcept
{
BoxedCode
*
o
=
static_cast
<
BoxedCode
*>
(
self
);
Py_VISIT
(
o
->
_filename
);
Py_VISIT
(
o
->
_name
);
return
0
;
}
void
BoxedCode
::
dealloc
(
Box
*
b
)
noexcept
{
void
BoxedCode
::
dealloc
(
Box
*
b
)
noexcept
{
BoxedCode
*
o
=
static_cast
<
BoxedCode
*>
(
b
);
BoxedCode
*
o
=
static_cast
<
BoxedCode
*>
(
b
);
PyObject_GC_UnTrack
(
o
);
Py_XDECREF
(
o
->
_filename
);
Py_XDECREF
(
o
->
_filename
);
Py_XDECREF
(
o
->
_name
);
Py_XDECREF
(
o
->
_name
);
...
@@ -210,9 +201,8 @@ extern "C" int PyCode_HasFreeVars(PyCodeObject* _code) noexcept {
...
@@ -210,9 +201,8 @@ extern "C" int PyCode_HasFreeVars(PyCodeObject* _code) noexcept {
}
}
void
setupCode
()
{
void
setupCode
()
{
code_cls
code_cls
=
BoxedClass
::
create
(
type_cls
,
object_cls
,
0
,
0
,
sizeof
(
BoxedCode
),
false
,
"code"
,
false
,
=
BoxedClass
::
create
(
type_cls
,
object_cls
,
0
,
0
,
sizeof
(
BoxedCode
),
false
,
"code"
,
false
,
(
destructor
)
BoxedCode
::
dealloc
,
NULL
,
false
,
(
traverseproc
)
NULL
,
NOCLEAR
);
(
destructor
)
BoxedCode
::
dealloc
,
NULL
,
true
,
(
traverseproc
)
BoxedCode
::
traverse
,
NOCLEAR
);
code_cls
->
giveAttrBorrowed
(
"__new__"
,
Py_None
);
// Hacky way of preventing users from instantiating this
code_cls
->
giveAttrBorrowed
(
"__new__"
,
Py_None
);
// Hacky way of preventing users from instantiating this
...
...
src/runtime/code.h
View file @
0be24aec
...
@@ -35,7 +35,7 @@ public:
...
@@ -35,7 +35,7 @@ public:
Py_XINCREF
(
name
);
Py_XINCREF
(
name
);
}
}
DEFAULT_CLASS
(
code_cls
);
DEFAULT_CLASS
_SIMPLE
(
code_cls
,
false
);
// These need to be static functions rather than methods because function
// These need to be static functions rather than methods because function
// pointers could point to them.
// pointers could point to them.
...
@@ -48,7 +48,6 @@ public:
...
@@ -48,7 +48,6 @@ public:
static
Box
*
varnames
(
Box
*
b
,
void
*
)
noexcept
;
static
Box
*
varnames
(
Box
*
b
,
void
*
)
noexcept
;
static
Box
*
flags
(
Box
*
b
,
void
*
)
noexcept
;
static
Box
*
flags
(
Box
*
b
,
void
*
)
noexcept
;
static
int
traverse
(
Box
*
self
,
visitproc
visit
,
void
*
arg
)
noexcept
;
static
void
dealloc
(
Box
*
b
)
noexcept
;
static
void
dealloc
(
Box
*
b
)
noexcept
;
};
};
}
}
...
...
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