diff options
author | 2013-10-08 11:54:06 +0200 | |
---|---|---|
committer | 2013-10-08 11:54:06 +0200 | |
commit | 3050f5c52a3fd1934f0240b05d9a70ac60ea4748 (patch) | |
tree | dc2efaa941d324a236bb7118c51aebc5cd3f4a47 | |
parent | Fix fix (diff) | |
download | pypy-3050f5c52a3fd1934f0240b05d9a70ac60ea4748.tar.gz pypy-3050f5c52a3fd1934f0240b05d9a70ac60ea4748.tar.bz2 pypy-3050f5c52a3fd1934f0240b05d9a70ac60ea4748.zip |
Translates and generally pass tests
-rw-r--r-- | TODO | 3 | ||||
-rw-r--r-- | rpython/memory/gc/incminimark.py | 3 | ||||
-rw-r--r-- | rpython/translator/c/test/test_newgc.py | 67 |
3 files changed, 7 insertions, 66 deletions
@@ -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 index 4e081c230c..c47e2f9534 100644 --- a/rpython/memory/gc/incminimark.py +++ b/rpython/memory/gc/incminimark.py @@ -256,7 +256,7 @@ class IncrementalMiniMarkGC(MovingGCBase): # 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 @@ class IncrementalMiniMarkGC(MovingGCBase): # ^^^ 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 index d49bc16394..9bbbd09480 100644 --- a/rpython/translator/c/test/test_newgc.py +++ b/rpython/translator/c/test/test_newgc.py @@ -1468,72 +1468,9 @@ class TestMiniMarkGC(TestSemiSpaceGC): res = self.run("nongc_opaque_attached_to_gc") assert res == 0 -class TestIncrementalMiniMarkGC(TestSemiSpaceGC): - 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 +class TestIncrementalMiniMarkGC(TestMiniMarkGC): + gcpolicy = "incminimark" # ____________________________________________________________________ |