def scan_and_print_new_objs(self, msg = None):
# Print list of new objs, making sure that the list is
# correctly garbage-collected by the GC
print "\n# -- %s:" % (msg or "New objects")
self.scan(self._print_new_obj)
print "# ---------------\n"
#
# Method 2: Keep track of the garbage list
# Advantages: we have live pointers to the new live objects. And fast
# Drawbacks: will only show the object /after/ the GC had tried to
# reclaim them, not as soon as they have been
# creaded. Still useful to debug leaks... But: are we sure
# that lost objects are only found in cycles ??? Same
# type restrictions as for method 1 ???
#
评论列表
文章目录