Author: Armin Rigo <[email protected]>
Branch:
Changeset: r76670:2485283de005
Date: 2015-04-01 12:06 +0200
http://bitbucket.org/pypy/pypy/changeset/2485283de005/
Log: Expand the docs
diff --git a/rpython/rlib/rgc.py b/rpython/rlib/rgc.py
--- a/rpython/rlib/rgc.py
+++ b/rpython/rlib/rgc.py
@@ -678,7 +678,12 @@
""" This function does not do anything, but called from any annotated
place, will tell that "func" is used to trace GC roots inside any instance
of the type TP. The func must be specified as "lambda: func" in this
- call, for internal reasons.
+ call, for internal reasons. Note that the func will be automatically
+ specialized on the 'callback' argument value. Example:
+
+ def customtrace(gc, obj, callback, arg):
+ gc._trace_callback(callback, arg, obj + offset_of_x)
+ lambda_customtrace = lambda: customtrace
"""
class RegisterGcTraceEntry(ExtRegistryEntry):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit