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
28f29554
Commit
28f29554
authored
Nov 13, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small fixes
parent
adb7c160
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
src/runtime/types.cpp
src/runtime/types.cpp
+5
-8
No files found.
src/runtime/types.cpp
View file @
28f29554
...
...
@@ -88,11 +88,10 @@ extern "C" void init_ssl();
extern
"C"
void
init_sqlite3
();
extern
"C"
void
PyMarshal_Init
();
extern
"C"
void
initstrop
();
extern
"C"
void
initgc
();
namespace
pyston
{
void
setupGC
();
std
::
vector
<
BoxedClass
*>
exception_types
;
extern
"C"
PyObject
*
PyType_GenericAlloc
(
PyTypeObject
*
type
,
Py_ssize_t
nitems
)
noexcept
{
...
...
@@ -3425,11 +3424,10 @@ void setupRuntime() {
// We have to do a little dance to get object_cls and type_cls set up, since the normal
// object-creation routines look at the class to see the allocation size.
object_cls
=
static_cast
<
BoxedClass
*>
(
PyObject_MALLOC
(
sizeof
(
BoxedClass
)));
PyObject_INIT
(
object_cls
,
NULL
);
::
new
(
object_cls
)
BoxedClass
(
NULL
,
0
,
0
,
sizeof
(
Box
),
false
,
"object"
);
type_cls
=
static_cast
<
BoxedClass
*>
(
PyObject_MALLOC
(
sizeof
(
BoxedClass
)));
PyObject_INIT
(
object_cls
,
type_cls
);
PyObject_INIT
(
type_cls
,
type_cls
);
::
new
(
object_cls
)
BoxedClass
(
NULL
,
0
,
0
,
sizeof
(
Box
),
false
,
"object"
);
::
new
(
type_cls
)
BoxedClass
(
object_cls
,
offsetof
(
BoxedClass
,
attrs
),
offsetof
(
BoxedClass
,
tp_weaklist
),
sizeof
(
BoxedHeapClass
),
false
,
"type"
);
...
...
@@ -3437,8 +3435,7 @@ void setupRuntime() {
type_cls
->
tp_flags
|=
Py_TPFLAGS_TYPE_SUBCLASS
;
type_cls
->
tp_itemsize
=
sizeof
(
BoxedHeapClass
::
SlotOffset
);
type_cls
->
tp_dealloc
=
BoxedClass
::
dealloc
;
PyObject_Init
(
object_cls
,
type_cls
);
PyObject_Init
(
type_cls
,
type_cls
);
// XXX silly that we have to set this again
new
(
&
object_cls
->
attrs
)
HCAttrs
(
HiddenClass
::
makeSingleton
());
new
(
&
type_cls
->
attrs
)
HCAttrs
(
HiddenClass
::
makeSingleton
());
...
...
@@ -3923,7 +3920,7 @@ void setupRuntime() {
setupBuiltins
();
_PyExc_Init
();
setupThread
();
setupGC
();
initgc
();
setupImport
();
setupPyston
();
setupAST
();
...
...
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