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
516b6544
Commit
516b6544
authored
Dec 16, 2014
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Shore up sys.flags
parent
f3ead53e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
src/runtime/builtin_modules/sys.cpp
src/runtime/builtin_modules/sys.cpp
+10
-4
No files found.
src/runtime/builtin_modules/sys.cpp
View file @
516b6544
...
...
@@ -84,18 +84,23 @@ void prependToSysPath(const std::string& path) {
static
BoxedClass
*
sys_flags_cls
;
class
BoxedSysFlags
:
public
Box
{
public:
Box
*
division_warning
,
*
bytes_warning
;
Box
*
division_warning
,
*
bytes_warning
,
*
no_user_site
;
BoxedSysFlags
()
:
Box
(
sys_flags_cls
)
{
auto
zero
=
boxInt
(
0
);
division_warning
=
zero
;
bytes_warning
=
zero
;
no_user_site
=
zero
;
}
static
void
gcHandler
(
GCVisitor
*
v
,
Box
*
b
)
{
assert
(
b
->
cls
==
sys_flags_cls
);
static
void
gcHandler
(
GCVisitor
*
v
,
Box
*
_b
)
{
assert
(
_b
->
cls
==
sys_flags_cls
);
boxGCHandler
(
v
,
_b
);
boxGCHandler
(
v
,
b
);
BoxedSysFlags
*
self
=
static_cast
<
BoxedSysFlags
*>
(
_b
);
v
->
visit
(
self
->
division_warning
);
v
->
visit
(
self
->
bytes_warning
);
v
->
visit
(
self
->
no_user_site
);
}
static
Box
*
__new__
(
Box
*
cls
,
Box
*
args
,
Box
*
kwargs
)
{
...
...
@@ -164,6 +169,7 @@ void setupSys() {
new BoxedMemberDescriptor(BoxedMemberDescriptor::OBJECT, offsetof(BoxedSysFlags, name)))
ADD
(
division_warning
);
ADD
(
bytes_warning
);
ADD
(
no_user_site
);
#undef ADD
sys_flags_cls
->
freeze
();
...
...
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