Author: Armin Rigo <[email protected]>
Branch:
Changeset: r170:e22d77eb0b4f
Date: 2013-06-17 14:22 +0200
http://bitbucket.org/pypy/stmgc/changeset/e22d77eb0b4f/
Log: Next test
diff --git a/c4/test/support.py b/c4/test/support.py
--- a/c4/test/support.py
+++ b/c4/test/support.py
@@ -433,6 +433,8 @@
rawsetptr(p, i, ffi.NULL)
return p
+ofree = lib.stmgcpage_free
+
def nalloc(size):
"Allocate a fresh object from the nursery"
p = lib.stm_allocate(size, 42 + size)
diff --git a/c4/test/test_gcpage.py b/c4/test/test_gcpage.py
--- a/c4/test/test_gcpage.py
+++ b/c4/test/test_gcpage.py
@@ -56,3 +56,9 @@
assert count_global_pages() == 2
p3, p4 = where
assert abs(distance(p3, p4)) > PAGE_ROOM / 2
+
+def test_malloc_reuse():
+ p1 = oalloc(HDR)
+ ofree(p1)
+ p2 = oalloc(HDR)
+ assert p2 == p1
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit