[pypy-commit] pypy incremental-gc: remove useless comment

andrewchambers noreply at buildbot.pypy.org
Wed Aug 7 09:59:51 CEST 2013


Author: Andrew Chambers <andrewchamberss at gmail.com>
Branch: incremental-gc
Changeset: r65987:d3689913003e
Date: 2013-08-07 17:46 +1200
http://bitbucket.org/pypy/pypy/changeset/d3689913003e/

Log:	remove useless comment

diff --git a/rpython/memory/gc/incminimark.py b/rpython/memory/gc/incminimark.py
--- a/rpython/memory/gc/incminimark.py
+++ b/rpython/memory/gc/incminimark.py
@@ -1734,110 +1734,6 @@
         
         while self.gc_state != STATE_SCANNING:
             self.major_collection_step(reserving_size)
-        
-        
-    
-    # ----------
-    # Full collection
-
-#    def major_collection(self, reserving_size=0):
-#        """Do a major collection.  Only for when the nursery is empty."""
-#        #
-#        debug_start("gc-collect")
-#        debug_print()
-#        debug_print(".----------- Full collection ------------------")
-#        debug_print("| used before collection:")
-#        debug_print("|          in ArenaCollection:     ",
-#                    self.ac.total_memory_used, "bytes")
-#        debug_print("|          raw_malloced:           ",
-#                    self.rawmalloced_total_size, "bytes")
-#        #
-#        # Debugging checks
-#        ll_assert(self.nursery_free == self.nursery,
-#                  "nursery not empty in major_collection()")
-#        self.debug_check_consistency()
-#        #
-#        # Note that a major collection is non-moving.  The goal is only to
-#        # find and free some of the objects allocated by the ArenaCollection.
-#        # We first visit all objects and toggle the flag GCFLAG_VISITED on
-#        # them, starting from the roots.
-#        self.objects_to_trace = self.AddressStack()
-#        self.collect_roots()
-#        self.visit_all_objects()
-#        #
-#        # Finalizer support: adds the flag GCFLAG_VISITED to all objects
-#        # with a finalizer and all objects reachable from there (and also
-#        # moves some objects from 'objects_with_finalizers' to
-#        # 'run_finalizers').
-#        if self.objects_with_finalizers.non_empty():
-#            self.deal_with_objects_with_finalizers()
-#        #
-#        self.objects_to_trace.delete()
-#        #
-#        # Weakref support: clear the weak pointers to dying objects
-#        if self.old_objects_with_weakrefs.non_empty():
-#            self.invalidate_old_weakrefs()
-#        if self.old_objects_with_light_finalizers.non_empty():
-#            self.deal_with_old_objects_with_finalizers()
-
-#        #
-#        # Walk all rawmalloced objects and free the ones that don't
-#        # have the GCFLAG_VISITED flag.
-#        self.free_unvisited_rawmalloc_objects()
-#        #
-#        # Ask the ArenaCollection to visit all objects.  Free the ones
-#        # that have not been visited above, and reset GCFLAG_VISITED on
-#        # the others.
-#        self.ac.mass_free(self._free_if_unvisited)
-#        #
-#        # We also need to reset the GCFLAG_VISITED on prebuilt GC objects.
-#        self.prebuilt_root_objects.foreach(self._reset_gcflag_visited, None)
-#        #
-#        self.debug_check_consistency()
-#        #
-#        self.num_major_collects += 1
-#        debug_print("| used after collection:")
-#        debug_print("|          in ArenaCollection:     ",
-#                    self.ac.total_memory_used, "bytes")
-#        debug_print("|          raw_malloced:           ",
-#                    self.rawmalloced_total_size, "bytes")
-#        debug_print("| number of major collects:        ",
-#                    self.num_major_collects)
-#        debug_print("`----------------------------------------------")
-#        debug_stop("gc-collect")
-#        #
-#        # Set the threshold for the next major collection to be when we
-#        # have allocated 'major_collection_threshold' times more than
-#        # we currently have -- but no more than 'max_delta' more than
-#        # we currently have.
-#        total_memory_used = float(self.get_total_memory_used())
-#        bounded = self.set_major_threshold_from(
-#            min(total_memory_used * self.major_collection_threshold,
-#                total_memory_used + self.max_delta),
-#            reserving_size)
-#        #
-#        # Max heap size: gives an upper bound on the threshold.  If we
-#        # already have at least this much allocated, raise MemoryError.
-#        if bounded and (float(self.get_total_memory_used()) + reserving_size >=
-#                        self.next_major_collection_initial):
-#            #
-#            # First raise MemoryError, giving the program a chance to
-#            # quit cleanly.  It might still allocate in the nursery,
-#            # which might eventually be emptied, triggering another
-#            # major collect and (possibly) reaching here again with an
-#            # even higher memory consumption.  To prevent it, if it's
-#            # the second time we are here, then abort the program.
-#            if self.max_heap_size_already_raised:
-#                llop.debug_fatalerror(lltype.Void,
-#                                      "Using too much memory, aborting")
-#            self.max_heap_size_already_raised = True
-#            raise MemoryError
-#        #
-#        # At the end, we can execute the finalizers of the objects
-#        # listed in 'run_finalizers'.  Note that this will typically do
-#        # more allocations.
-#        self.execute_finalizers()
-
 
     def _free_if_unvisited(self, hdr):
         size_gc_header = self.gcheaderbuilder.size_gc_header


More information about the pypy-commit mailing list