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
4d548d3b
Commit
4d548d3b
authored
Sep 17, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Can reproduce the class-and-inst bug now
parent
a7841500
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
src/gc/heap.cpp
src/gc/heap.cpp
+6
-2
test/tests/class_and_instance_freeing.py
test/tests/class_and_instance_freeing.py
+14
-0
No files found.
src/gc/heap.cpp
View file @
4d548d3b
...
@@ -488,7 +488,11 @@ void SmallArena::freeUnmarked(std::vector<Box*>& weakly_referenced) {
...
@@ -488,7 +488,11 @@ void SmallArena::freeUnmarked(std::vector<Box*>& weakly_referenced) {
assertConsistent
();
assertConsistent
();
thread_caches
.
forEachValue
([
this
,
&
weakly_referenced
](
ThreadBlockCache
*
cache
)
{
thread_caches
.
forEachValue
([
this
,
&
weakly_referenced
](
ThreadBlockCache
*
cache
)
{
for
(
int
bidx
=
0
;
bidx
<
NUM_BUCKETS
;
bidx
++
)
{
// Iterate over the buckets from largest to smallest. I don't think it really matters, but
// doing it in this order means that we will tend to free types early in the sweep (since they
// are fairly large), and we are more likely to detect if other code depended on that type
// being alive.
for
(
int
bidx
=
NUM_BUCKETS
-
1
;
bidx
>=
0
;
bidx
--
)
{
Block
*
h
=
cache
->
cache_free_heads
[
bidx
];
Block
*
h
=
cache
->
cache_free_heads
[
bidx
];
// Try to limit the amount of unused memory a thread can hold onto;
// Try to limit the amount of unused memory a thread can hold onto;
// currently pretty dumb, just limit the number of blocks in the free-list
// currently pretty dumb, just limit the number of blocks in the free-list
...
@@ -517,7 +521,7 @@ void SmallArena::freeUnmarked(std::vector<Box*>& weakly_referenced) {
...
@@ -517,7 +521,7 @@ void SmallArena::freeUnmarked(std::vector<Box*>& weakly_referenced) {
}
}
});
});
for
(
int
bidx
=
0
;
bidx
<
NUM_BUCKETS
;
bidx
++
)
{
for
(
int
bidx
=
NUM_BUCKETS
-
1
;
bidx
>=
0
;
bidx
--
)
{
Block
**
chain_end
=
_freeChain
(
&
heads
[
bidx
],
weakly_referenced
);
Block
**
chain_end
=
_freeChain
(
&
heads
[
bidx
],
weakly_referenced
);
_freeChain
(
&
full_heads
[
bidx
],
weakly_referenced
);
_freeChain
(
&
full_heads
[
bidx
],
weakly_referenced
);
...
...
test/tests/class_and_instance_freeing.py
0 → 100644
View file @
4d548d3b
import
gc
l
=
[]
for
i
in
xrange
(
5100
):
class
C
(
object
):
pass
C
.
l
=
[
C
()
for
_
in
xrange
(
17
)]
if
i
%
10
==
0
:
print
i
# gc.collect()
# for i in xrange(100):
# l.append('=' * i)
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