Author: Armin Rigo <[email protected]>
Branch:
Changeset: r317:95b19b2a2ee3
Date: 2013-06-29 11:06 +0200
http://bitbucket.org/pypy/stmgc/changeset/95b19b2a2ee3/
Log: Add a test for the gcptrlist_insert(&d->old_objects_to_trace) after
stmgcpage_malloc()
diff --git a/c4/test/test_nursery.py b/c4/test/test_nursery.py
--- a/c4/test/test_nursery.py
+++ b/c4/test/test_nursery.py
@@ -298,9 +298,19 @@
assert lib.getlong(p2, 0) == 389719
def test_nalloc_large_object():
- for words in range(80):
- p1 = nalloc(HDR + words * WORD)
- # assert did not crash
+ for words in range(40, 81):
+ p1 = nalloc_refs(words)
+ lib.rawsetptr(p1, 0, p1)
+ p2 = nalloc(HDR) # this alone should not collect
+ check_not_free(p1)
+ lib.rawsetptr(p1, 79, p2)
+ lib.stm_push_root(p1)
+ minor_collect()
+ p1b = lib.stm_pop_root()
+ assert p1b == p1
+ check_not_free(p1)
+ assert lib.rawgetptr(p1, 0) == p1
+ check_not_free(lib.rawgetptr(p1, 79))
def test_collect_soon():
lib.stmgc_minor_collect_soon()
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit