Loading buildstream/_loader/loader.py +19 −0 Original line number Original line Diff line number Diff line Loading @@ -152,8 +152,27 @@ class Loader(): # # ret.append(loader._collect_element(element)) ret.append(loader._collect_element(element)) self._clean_caches() return ret return ret # clean_caches() # # Clean internal loader caches, recursively # # When loading the elements, the loaders use caches in order to not load the # same element twice. These are kept after loading and prevent garbage # collection. Cleaning them explicitely is required. # def _clean_caches(self): for loader in self._loaders.values(): # value may be None with nested junctions without overrides if loader is not None: loader._clean_caches() self._meta_elements = {} self._elements = {} ########################################### ########################################### # Private Methods # # Private Methods # ########################################### ########################################### Loading buildstream/_project.py +2 −0 Original line number Original line Diff line number Diff line Loading @@ -358,6 +358,8 @@ class Project(): for meta in meta_elements for meta in meta_elements ] ] Element._clear_meta_elements_cache() # Now warn about any redundant source references which may have # Now warn about any redundant source references which may have # been discovered in the resolve() phase. # been discovered in the resolve() phase. redundant_refs = Element._get_redundant_source_refs() redundant_refs = Element._get_redundant_source_refs() Loading buildstream/element.py +15 −0 Original line number Original line Diff line number Diff line Loading @@ -966,6 +966,21 @@ class Element(Plugin): return element return element # _clear_meta_elements_cache() # # Clear the internal meta elements cache. # # When loading elements from meta, we cache already instantiated elements # in order to not have to load the same elements twice. # This clears the cache. # # It should be called whenever we are done loading all elements in order # to save memory. # @classmethod def _clear_meta_elements_cache(cls): cls.__instantiated_elements = {} # _get_redundant_source_refs() # _get_redundant_source_refs() # # # Fetches a list of (Source, ref) tuples of all the Sources # Fetches a list of (Source, ref) tuples of all the Sources Loading Loading
buildstream/_loader/loader.py +19 −0 Original line number Original line Diff line number Diff line Loading @@ -152,8 +152,27 @@ class Loader(): # # ret.append(loader._collect_element(element)) ret.append(loader._collect_element(element)) self._clean_caches() return ret return ret # clean_caches() # # Clean internal loader caches, recursively # # When loading the elements, the loaders use caches in order to not load the # same element twice. These are kept after loading and prevent garbage # collection. Cleaning them explicitely is required. # def _clean_caches(self): for loader in self._loaders.values(): # value may be None with nested junctions without overrides if loader is not None: loader._clean_caches() self._meta_elements = {} self._elements = {} ########################################### ########################################### # Private Methods # # Private Methods # ########################################### ########################################### Loading
buildstream/_project.py +2 −0 Original line number Original line Diff line number Diff line Loading @@ -358,6 +358,8 @@ class Project(): for meta in meta_elements for meta in meta_elements ] ] Element._clear_meta_elements_cache() # Now warn about any redundant source references which may have # Now warn about any redundant source references which may have # been discovered in the resolve() phase. # been discovered in the resolve() phase. redundant_refs = Element._get_redundant_source_refs() redundant_refs = Element._get_redundant_source_refs() Loading
buildstream/element.py +15 −0 Original line number Original line Diff line number Diff line Loading @@ -966,6 +966,21 @@ class Element(Plugin): return element return element # _clear_meta_elements_cache() # # Clear the internal meta elements cache. # # When loading elements from meta, we cache already instantiated elements # in order to not have to load the same elements twice. # This clears the cache. # # It should be called whenever we are done loading all elements in order # to save memory. # @classmethod def _clear_meta_elements_cache(cls): cls.__instantiated_elements = {} # _get_redundant_source_refs() # _get_redundant_source_refs() # # # Fetches a list of (Source, ref) tuples of all the Sources # Fetches a list of (Source, ref) tuples of all the Sources Loading