Author: Armin Rigo <[email protected]>
Branch:
Changeset: r71789:2176b15be96f
Date: 2014-05-31 19:23 +0200
http://bitbucket.org/pypy/pypy/changeset/2176b15be96f/
Log: By default, use for the RPython-level 'str(instance)' a different
"address" number which corresponds to the id. That's needed to
debug some kind of problems.
diff --git a/rpython/rtyper/lltypesystem/rclass.py
b/rpython/rtyper/lltypesystem/rclass.py
--- a/rpython/rtyper/lltypesystem/rclass.py
+++ b/rpython/rtyper/lltypesystem/rclass.py
@@ -585,7 +585,11 @@
if not i:
return rstr.null_str
instance = cast_pointer(OBJECTPTR, i)
- uid = r_uint(cast_ptr_to_int(i))
+ # Two choices: the first gives a fast answer but it can change
+ # (typically only once) during the life of the object.
+ #uid = r_uint(cast_ptr_to_int(i))
+ uid = llop.gc_id(lltype.Unsigned, i)
+ #
nameLen = len(instance.typeptr.name)
nameString = rstr.mallocstr(nameLen-1)
i = 0
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit