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
1d9e4b05
Commit
1d9e4b05
authored
Jan 18, 2016
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Register gc handler of capi_getset_cls
parent
33e1028b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
src/runtime/types.cpp
src/runtime/types.cpp
+8
-2
src/runtime/types.h
src/runtime/types.h
+1
-5
No files found.
src/runtime/types.cpp
View file @
1d9e4b05
...
...
@@ -1481,6 +1481,12 @@ void BoxedInstanceMethod::gcHandler(GCVisitor* v, Box* b) {
v
->
visit
(
&
im
->
im_class
);
}
void
BoxedGetsetDescriptor
::
gcHandler
(
GCVisitor
*
v
,
Box
*
b
)
{
assert
(
isSubclass
(
b
->
cls
,
pyston_getset_cls
)
||
isSubclass
(
b
->
cls
,
capi_getset_cls
));
BoxedGetsetDescriptor
*
descr
=
static_cast
<
BoxedGetsetDescriptor
*>
(
b
);
v
->
visit
(
&
descr
->
name
);
}
void
BoxedProperty
::
gcHandler
(
GCVisitor
*
v
,
Box
*
b
)
{
Box
::
gcHandler
(
v
,
b
);
...
...
@@ -3835,8 +3841,8 @@ void setupRuntime() {
sizeof
(
BoxedSet
),
false
,
"set"
);
frozenset_cls
=
BoxedClass
::
create
(
type_cls
,
object_cls
,
&
BoxedSet
::
gcHandler
,
0
,
offsetof
(
BoxedSet
,
weakreflist
),
sizeof
(
BoxedSet
),
false
,
"frozenset"
);
capi_getset_cls
=
BoxedClass
::
create
(
type_cls
,
object_cls
,
NULL
,
0
,
0
,
sizeof
(
BoxedGetsetDescriptor
),
false
,
"getset"
);
capi_getset_cls
=
BoxedClass
::
create
(
type_cls
,
object_cls
,
&
BoxedGetsetDescriptor
::
gcHandler
,
0
,
0
,
sizeof
(
BoxedGetsetDescriptor
),
false
,
"getset"
);
closure_cls
=
BoxedClass
::
create
(
type_cls
,
object_cls
,
&
BoxedClosure
::
gcHandler
,
0
,
0
,
sizeof
(
BoxedClosure
),
false
,
"closure"
);
property_cls
=
BoxedClass
::
create
(
type_cls
,
object_cls
,
&
BoxedProperty
::
gcHandler
,
0
,
0
,
sizeof
(
BoxedProperty
),
...
...
src/runtime/types.h
View file @
1d9e4b05
...
...
@@ -953,11 +953,7 @@ public:
BoxedGetsetDescriptor
(
BoxedString
*
name
,
Box
*
(
*
get
)(
Box
*
,
void
*
),
void
(
*
set
)(
Box
*
,
Box
*
,
void
*
),
void
*
closure
)
:
get
(
get
),
set
(
set
),
closure
(
closure
),
name
(
name
)
{}
static
void
gcHandler
(
GCVisitor
*
v
,
Box
*
b
)
{
assert
(
b
->
cls
==
pyston_getset_cls
);
BoxedGetsetDescriptor
*
descr
=
static_cast
<
BoxedGetsetDescriptor
*>
(
b
);
v
->
visit
(
&
descr
->
name
);
}
static
void
gcHandler
(
GCVisitor
*
v
,
Box
*
b
);
// No DEFAULT_CLASS annotation here -- force callers to explicitly specifiy pyston_getset_cls or capi_getset_cls
};
...
...
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