Author: Remi Meier <[email protected]>
Branch: stmgc-c8
Changeset: r80855:fb5ae8f4f26c
Date: 2015-11-23 14:34 +0100
http://bitbucket.org/pypy/pypy/changeset/fb5ae8f4f26c/
Log: minor tweak
In STM, we call the trace callback even if an obj doesn't have any
gcptrs in it, since we unify STM and GC write barriers and don't
make use of this information.
diff --git a/rpython/memory/gctransform/stmframework.py
b/rpython/memory/gctransform/stmframework.py
--- a/rpython/memory/gctransform/stmframework.py
+++ b/rpython/memory/gctransform/stmframework.py
@@ -57,6 +57,13 @@
annmodel.SomeInteger()))
#
def pypy_stmcb_trace(obj, visit_fn):
+ typeid = gc.get_type_id(obj)
+ if not gc.has_gcptr(typeid):
+ # fastpath, since in STM we don't distinguish between objs
+ # that have gcptrs and those that don't. It would make only
+ # little sense in STM, since all objs need write barriers, even
+ # those without gcptrs. (still, possible XXX)
+ return
gc.tracei(obj, invokecallback, visit_fn)
pypy_stmcb_trace.c_name = "pypy_stmcb_trace"
self.autoregister_ptrs.append(
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit