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
51cf8080
Commit
51cf8080
authored
Jun 17, 2014
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A variety of GC fixes
parent
4da376b5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
7 deletions
+12
-7
src/jit.cpp
src/jit.cpp
+3
-3
src/runtime/builtin_modules/builtins.cpp
src/runtime/builtin_modules/builtins.cpp
+3
-1
src/runtime/objmodel.cpp
src/runtime/objmodel.cpp
+3
-0
src/runtime/types.cpp
src/runtime/types.cpp
+3
-3
No files found.
src/jit.cpp
View file @
51cf8080
...
...
@@ -87,6 +87,9 @@ int main(int argc, char** argv) {
const
char
*
fn
=
NULL
;
threading
::
registerMainThread
();
threading
::
GLReadRegion
_glock
;
{
Timer
_t
(
"for initCodegen"
);
initCodegen
();
...
...
@@ -108,9 +111,6 @@ int main(int argc, char** argv) {
// end of argument parsing
threading
::
registerMainThread
();
threading
::
GLReadRegion
_glock
;
_t
.
split
(
"to run"
);
if
(
fn
!=
NULL
)
{
BoxedModule
*
main
=
createModule
(
"__main__"
,
fn
);
...
...
src/runtime/builtin_modules/builtins.cpp
View file @
51cf8080
...
...
@@ -14,6 +14,7 @@
#include <algorithm>
#include <cstddef>
#include <err.h>
#include "codegen/compvars.h"
#include "core/ast.h"
...
...
@@ -195,7 +196,8 @@ Box* open(Box* arg1, Box* arg2) {
const
std
::
string
&
mode
=
static_cast
<
BoxedString
*>
(
arg2
)
->
s
;
FILE
*
f
=
fopen
(
fn
.
c_str
(),
mode
.
c_str
());
RELEASE_ASSERT
(
f
,
""
);
if
(
!
f
)
raiseExcHelper
(
IOError
,
"%s: '%s' '%s'"
,
strerror
(
errno
),
fn
.
c_str
());
return
new
BoxedFile
(
f
);
}
...
...
src/runtime/objmodel.cpp
View file @
51cf8080
...
...
@@ -300,6 +300,9 @@ BoxedClass::BoxedClass(BoxedClass* base, int attrs_offset, int instance_size, bo
assert
(
instance_size
>=
attrs_offset
+
sizeof
(
HCAttrs
));
assert
(
attrs_offset
%
sizeof
(
void
*
)
==
0
);
// Not critical I suppose, but probably signals a bug
}
if
(
!
is_user_defined
)
gc
::
registerStaticRootObj
(
this
);
}
extern
"C"
const
std
::
string
*
getNameOfClass
(
BoxedClass
*
cls
)
{
...
...
src/runtime/types.cpp
View file @
51cf8080
...
...
@@ -110,8 +110,8 @@ extern "C" void functionGCHandler(GCVisitor* v, void* p) {
assert
(
f
->
defaults
);
v
->
visit
(
f
->
defaults
);
// do a conservative scan since there can be NULLs in there:
v
->
visitPotentialRange
(
reinterpret_cast
<
void
*
const
*>
(
&
f
->
defaults
[
0
]),
reinterpret_cast
<
void
*
const
*>
(
&
f
->
defaults
[
f
->
ndefaults
]));
v
->
visitPotentialRange
(
reinterpret_cast
<
void
*
const
*>
(
&
f
->
defaults
->
elts
[
0
]),
reinterpret_cast
<
void
*
const
*>
(
&
f
->
defaults
->
elts
[
f
->
ndefaults
]));
}
}
...
...
@@ -443,7 +443,7 @@ Box* objectNew(BoxedClass* cls, BoxedTuple* args) {
bool
TRACK_ALLOCATIONS
=
false
;
void
setupRuntime
()
{
HiddenClass
::
getRoot
(
);
gc
::
registerStaticRootObj
(
HiddenClass
::
getRoot
()
);
object_cls
=
new
BoxedClass
(
NULL
,
0
,
sizeof
(
Box
),
false
);
type_cls
=
new
BoxedClass
(
object_cls
,
offsetof
(
BoxedClass
,
attrs
),
sizeof
(
BoxedClass
),
false
);
...
...
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