Author: Antonio Cuni <[email protected]>
Branch: gc-disable
Changeset: r94710:f28af902fb66
Date: 2018-05-29 11:25 +0200
http://bitbucket.org/pypy/pypy/changeset/f28af902fb66/
Log: this looks like a typo which was introduced by 490058ea54e6; add a
test and fix
diff --git a/rpython/memory/gc/incminimark.py b/rpython/memory/gc/incminimark.py
--- a/rpython/memory/gc/incminimark.py
+++ b/rpython/memory/gc/incminimark.py
@@ -760,7 +760,7 @@
def collect(self, gen=2):
"""Do a minor (gen=0), start a major (gen=1), or do a full
major (gen>=2) collection."""
- if gen < 0:
+ if gen <= 0:
self._minor_collection() # dangerous! no major GC cycle progress
elif gen <= 1:
self.minor_collection_with_major_progress(force_enabled=True)
diff --git a/rpython/memory/gc/test/test_direct.py
b/rpython/memory/gc/test/test_direct.py
--- a/rpython/memory/gc/test/test_direct.py
+++ b/rpython/memory/gc/test/test_direct.py
@@ -771,6 +771,12 @@
assert elem.prev == lltype.nullptr(S)
assert elem.next == lltype.nullptr(S)
+ def test_collect_0(self, debuglog):
+ self.gc.collect(1) # start a major
+ debuglog.reset()
+ self.gc.collect(0) # do ONLY a minor
+ assert debuglog.summary() == {'gc-minor': 1}
+
def test_enable_disable(self, debuglog):
def large_malloc():
# malloc an object which is large enough to trigger a major
collection
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit