Author: Armin Rigo <[email protected]>
Branch:
Changeset: r33:34499de37f69
Date: 2013-05-26 21:14 +0200
http://bitbucket.org/pypy/stmgc/changeset/34499de37f69/
Log: progress
diff --git a/c3/test/support.py b/c3/test/support.py
--- a/c3/test/support.py
+++ b/c3/test/support.py
@@ -96,6 +96,7 @@
#define GCFLAG_WRITE_BARRIER ...
#define GCFLAG_NURSERY_MOVED ...
#define GCFLAG_OLD ...
+ #define GCFLAG_STUB ...
#define ABRT_MANUAL ...
typedef struct { ...; } page_header_t;
''')
@@ -451,6 +452,12 @@
def minor_collect():
lib.stmgc_minor_collect()
+STUB_TID = GCFLAG_STUB | GCFLAG_OLD | 0 # no user tid
+
+def is_stub(p):
+ assert lib.stm_dbgmem_is_active(p, 1) != 0
+ return p.h_tid == STUB_TID
+
def check_not_free(p):
assert lib.stm_dbgmem_is_active(p, 1) == 1
assert 42 < (p.h_tid & 0xFFFF) < 521
diff --git a/c3/test/test_random.py b/c3/test/test_random.py
--- a/c3/test/test_random.py
+++ b/c3/test/test_random.py
@@ -78,7 +78,7 @@
def check(self, p):
assert isinstance(p, Pair)
- if p != emptypair:
+ if p != emptypair and not is_stub(p.ptr):
self.check_not_free(p.ptr)
pid = lib.rawgetptr(p.ptr, 2)
assert pid == p.obj.identity
@@ -387,7 +387,7 @@
if k1 == 82 and self.interruptible_transaction:
self.dump('~~~~~~~~~~~~~~~~~~~~ ABORT ~~~~~~~~~~~~~~~~~~~~')
self.expected_abort(manual=True)
- lib.stm_abort_and_retry()
+ abort_and_retry()
elif k == 12: # only do an stm_read_barrier
p = self.read_barrier(p)
self.dump('-')
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit