Lines Matching refs:gc
1 import gc
414 # "weakref callbacks and gc corrupt memory"
416 # already in the process of getting deallocated to gc,
418 # callback that triggered gc.
424 import gc
430 wr = weakref.ref(c, lambda ignore: gc.collect())
438 wr = weakref.ref(c1.i, lambda ignore: gc.collect())
445 # that c2 is immune from gc while the weakref callbacks associated
448 # so any gc triggered by weakref callbacks associated with anything
454 import gc
473 # Instead they have to wait for cyclic gc to deduce that they're
476 # gc used to call tp_clear on all of them, and the order in which
478 # built up these things manages to provoke gc into running tp_clear
491 gc.collect()
494 import gc
520 gc.collect()
523 import gc
544 gc.collect()
547 import gc
572 gc.collect()
575 import gc
582 # But gc clears trash weakrefs with callbacks early now, which
607 gc.collect()
617 gc.collect()
621 import gc
646 # gets reclaimed at the end of gc.
650 gc.collect()
655 gc.collect()
665 thresholds = gc.get_threshold()
666 gc.set_threshold(1, 1, 1)
667 gc.collect()
687 gc.set_threshold(*thresholds)
707 gc.collect()
720 gc.collect()
725 gc.collect()
747 gc.collect()
770 gc.collect()
796 gc.collect()
917 gc.collect()
920 gc.collect()
934 self.addCleanup(gc.set_threshold, *gc.get_threshold())
937 gc.collect(0)
938 gc.set_threshold(th, th, th)