~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/btree_index.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-10-20 05:12:09 UTC
  • mfrom: (4744.2.9 2.1-peak-mem-tweak)
  • Revision ID: pqm@pqm.ubuntu.com-20091020051209-telne1xq2bq6cp7m
(jam) In GCCHKStreamSource clear caches after we fetch from a VF

Show diffs side-by-side

added added

removed removed

Lines of Context:
853
853
            new_tips = next_tips
854
854
        return final_offsets
855
855
 
 
856
    def clear_cache(self):
 
857
        """Clear out any cached/memoized values.
 
858
 
 
859
        This can be called at any time, but generally it is used when we have
 
860
        extracted some information, but don't expect to be requesting any more
 
861
        from this index.
 
862
        """
 
863
        # Note that we don't touch self._root_node or self._internal_node_cache
 
864
        # We don't expect either of those to be big, and it can save
 
865
        # round-trips in the future. We may re-evaluate this if InternalNode
 
866
        # memory starts to be an issue.
 
867
        self._leaf_node_cache.clear()
 
868
 
856
869
    def external_references(self, ref_list_num):
857
870
        if self._root_node is None:
858
871
            self._get_root_node()