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
ed11ebae
Commit
ed11ebae
authored
Sep 01, 2015
by
Rudi Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow GCVisitor visit methods to be virtual if we toggle a flag.
parent
86f365c7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
src/gc/gc.h
src/gc/gc.h
+15
-0
No files found.
src/gc/gc.h
View file @
ed11ebae
...
...
@@ -55,6 +55,14 @@ void popGCObject(gc::GCVisitable* obj);
namespace
gc
{
class
TraceStack
;
// The base version of the GC visitor is used for marking, in conjuction with a TraceStack.
//
// Conceptually, GCVisitor should be abstract and the 'marking' behavior should be specific
// to a subclass of GCVisitor. However, that requires the use of virtual functions which
// introduce an overhead. Eventually if we really need multiple different kinds of visitors
// we will need some dispatching mechanism but for now, since the moving GC is still WIP,
// the virtualness property is #if'd out for the regular use case with only mark-and-sweep.
class
GCVisitor
{
private:
TraceStack
*
stack
;
...
...
@@ -68,10 +76,17 @@ public:
if
(
p
)
visit
(
p
);
}
#if MOVING_GC
virtual
void
visit
(
void
*
p
);
virtual
void
visitRange
(
void
*
const
*
start
,
void
*
const
*
end
);
virtual
void
visitPotential
(
void
*
p
);
virtual
void
visitPotentialRange
(
void
*
const
*
start
,
void
*
const
*
end
);
#else
void
visit
(
void
*
p
);
void
visitRange
(
void
*
const
*
start
,
void
*
const
*
end
);
void
visitPotential
(
void
*
p
);
void
visitPotentialRange
(
void
*
const
*
start
,
void
*
const
*
end
);
#endif
// Some object have fields with pointers to Pyston heap objects that we are confident are
// already being scanned elsewhere.
...
...
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