Author: Armin Rigo <[email protected]>
Branch: stm-thread-2
Changeset: r57272:296bf379ee86
Date: 2012-09-10 14:23 +0200
http://bitbucket.org/pypy/pypy/changeset/296bf379ee86/
Log: Add a can_move() for the JIT.
diff --git a/pypy/rpython/memory/gc/stmgc.py b/pypy/rpython/memory/gc/stmgc.py
--- a/pypy/rpython/memory/gc/stmgc.py
+++ b/pypy/rpython/memory/gc/stmgc.py
@@ -357,6 +357,15 @@
# XXX improve hash(nursery_object)
return mangle_hash(llmemory.cast_adr_to_int(obj))
+ def can_move(self, obj):
+ tls = self.get_tls()
+ if tls.is_in_nursery(addr):
+ return True
+ else:
+ # XXX for now a pointer to a non-nursery object is
+ # always valid, as long as we don't have global collections
+ return False
+
# ____________________________________________________________
# helpers
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit