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
adb9ad0c
Commit
adb9ad0c
authored
Sep 17, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
microoptimizations
parent
0aa5dea8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
src/gc/heap.cpp
src/gc/heap.cpp
+4
-4
No files found.
src/gc/heap.cpp
View file @
adb9ad0c
...
...
@@ -160,10 +160,10 @@ __attribute__((always_inline)) bool isWeaklyReferenced(Box* b) {
Heap
global_heap
;
static
StatCounter
gc_safe_destructors
(
"gc_safe_destructor_calls"
);
__attribute__
((
always_inline
))
bool
_doFree
(
GCAllocation
*
al
,
std
::
vector
<
Box
*>*
weakly_referenced
,
std
::
vector
<
BoxedClass
*>*
classes_to_free
)
{
static
StatCounter
gc_safe_destructors
(
"gc_safe_destructor_calls"
);
#ifndef NVALGRIND
VALGRIND_DISABLE_ERROR_REPORTING
;
#endif
...
...
@@ -183,7 +183,7 @@ __attribute__((always_inline)) bool _doFree(GCAllocation* al, std::vector<Box*>*
#endif
assert
(
b
->
cls
);
if
(
isWeaklyReferenced
(
b
))
{
if
(
unlikely
(
isWeaklyReferenced
(
b
)
))
{
assert
(
weakly_referenced
&&
"attempting to free a weakly referenced object manually"
);
weakly_referenced
->
push_back
(
b
);
GC_TRACE_LOG
(
"%p is weakly referenced
\n
"
,
al
->
user_data
);
...
...
@@ -193,7 +193,7 @@ __attribute__((always_inline)) bool _doFree(GCAllocation* al, std::vector<Box*>*
ASSERT
(
!
hasOrderedFinalizer
(
b
->
cls
)
||
hasFinalized
(
al
),
"%s"
,
getTypeName
(
b
));
// Note: do this check after the weakrefs check.
if
(
PyType_Check
(
b
))
{
if
(
unlikely
(
PyType_Check
(
b
)
))
{
assert
(
classes_to_free
);
classes_to_free
->
push_back
(
static_cast
<
BoxedClass
*>
(
b
));
return
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