Author: Armin Rigo <[email protected]>
Branch: incremental-gc
Changeset: r67198:0fe88e84d8bc
Date: 2013-10-08 11:54 +0200
http://bitbucket.org/pypy/pypy/changeset/0fe88e84d8bc/
Log: Translates and generally pass tests
diff --git a/TODO b/TODO
--- a/TODO
+++ b/TODO
@@ -14,3 +14,6 @@
* REDO external_malloc(): if somebody calls this function a lot, we must
eventually force a full collection.
+
+* REDO card marking, starting with "card_page_indices": 128 in
+ TRANSLATION_PARAMS
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
@@ -256,7 +256,7 @@
# value of 128 means that card pages are 512 bytes (1024 on 64-bits)
# in regular arrays of pointers; more in arrays whose items are
# larger. A value of 0 disables card marking.
- "card_page_indices": 128,
+ "card_page_indices": 0, # XXX was 128,
# Objects whose total size is at least 'large_object' bytes are
# allocated out of the nursery immediately, as old objects. The
@@ -1410,6 +1410,7 @@
# ^^^ a fast path of write-barrier
#
if source_hdr.tid & GCFLAG_HAS_CARDS != 0:
+ assert self.card_page_indices > 0
#
if source_hdr.tid & GCFLAG_TRACK_YOUNG_PTRS == 0:
# The source object may have random young pointers.
diff --git a/rpython/translator/c/test/test_newgc.py
b/rpython/translator/c/test/test_newgc.py
--- a/rpython/translator/c/test/test_newgc.py
+++ b/rpython/translator/c/test/test_newgc.py
@@ -1468,72 +1468,9 @@
res = self.run("nongc_opaque_attached_to_gc")
assert res == 0
-class TestIncrementalMiniMarkGC(TestSemiSpaceGC):
+
+class TestIncrementalMiniMarkGC(TestMiniMarkGC):
gcpolicy = "incminimark"
- should_be_moving = True
- GC_CAN_MALLOC_NONMOVABLE = True
- GC_CAN_SHRINK_ARRAY = True
-
- def test_gc_heap_stats(self):
- py.test.skip("not implemented")
-
- def define_nongc_attached_to_gc(cls):
- from rpython.rtyper.lltypesystem import rffi
- ARRAY = rffi.CArray(rffi.INT)
- class A:
- def __init__(self, n):
- self.buf = lltype.malloc(ARRAY, n, flavor='raw',
- add_memory_pressure=True)
- def __del__(self):
- lltype.free(self.buf, flavor='raw')
- A(6)
- def f():
- # allocate a total of ~77GB, but if the automatic gc'ing works,
- # it should never need more than a few MBs at once
- am1 = am2 = am3 = None
- res = 0
- for i in range(1, 100001):
- if am3 is not None:
- res += rffi.cast(lltype.Signed, am3.buf[0])
- am3 = am2
- am2 = am1
- am1 = A(i * 4)
- am1.buf[0] = rffi.cast(rffi.INT, i - 50000)
- return res
- return f
-
- def test_nongc_attached_to_gc(self):
- res = self.run("nongc_attached_to_gc")
- assert res == -99997
-
- def define_nongc_opaque_attached_to_gc(cls):
- from rpython.rlib import rgc, ropenssl
-
- class A:
- def __init__(self):
- self.ctx = lltype.malloc(ropenssl.EVP_MD_CTX.TO,
- flavor='raw')
- digest = ropenssl.EVP_get_digestbyname('sha1')
- ropenssl.EVP_DigestInit(self.ctx, digest)
- rgc.add_memory_pressure(ropenssl.HASH_MALLOC_SIZE + 64)
-
- def __del__(self):
- ropenssl.EVP_MD_CTX_cleanup(self.ctx)
- lltype.free(self.ctx, flavor='raw')
- #A() --- can't call it here?? get glibc crashes on tannit64
- def f():
- am1 = am2 = am3 = None
- for i in range(100000):
- am3 = am2
- am2 = am1
- am1 = A()
- # what can we use for the res?
- return 0
- return f
-
- def test_nongc_opaque_attached_to_gc(self):
- res = self.run("nongc_opaque_attached_to_gc")
- assert res == 0
# ____________________________________________________________________
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit