Author: Armin Rigo <[email protected]>
Branch:
Changeset: r171:1654bffcfe89
Date: 2013-06-17 14:31 +0200
http://bitbucket.org/pypy/stmgc/changeset/1654bffcfe89/
Log: Next test
diff --git a/c4/gcpage.c b/c4/gcpage.c
--- a/c4/gcpage.c
+++ b/c4/gcpage.c
@@ -56,6 +56,11 @@
{
if (nblocks_for_size[1] == 0)
init_global_data();
+
+ /* Take back ownership of the pages currently assigned to
+ LOCAL_GCPAGES that come from a previous thread. */
+ struct tx_public_descriptor *gcp = LOCAL_GCPAGES();
+ count_global_pages -= gcp->count_pages;
}
void stmgcpage_done_tls(void)
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
@@ -62,3 +62,13 @@
ofree(p1)
p2 = oalloc(HDR)
assert p2 == p1
+
+def test_move_away_as_full_pages():
+ assert count_global_pages() == 0
+ oalloc(HDR)
+ assert count_pages() == 1
+ lib.stm_finalize()
+ assert count_global_pages() == 1
+ lib.stm_initialize_and_set_max_abort(0) # reuse the same
+ assert count_global_pages() == 0
+ assert count_pages() == 1
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit