diff options
author | Steven Knight <knight@baldmt.com> | 2005-01-23 03:05:05 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2005-01-23 03:05:05 (GMT) |
commit | 9b2dae34a2a0fd013b7849e4f8a8d7adb1bc136c (patch) | |
tree | a3d67b02d8d2a64a38b697baafaede1d7004be79 /src/engine/SCons/Executor.py | |
parent | f7158d025b936cc3cf3f0579ef39df98dc74e8cb (diff) | |
download | SCons-9b2dae34a2a0fd013b7849e4f8a8d7adb1bc136c.zip SCons-9b2dae34a2a0fd013b7849e4f8a8d7adb1bc136c.tar.gz SCons-9b2dae34a2a0fd013b7849e4f8a8d7adb1bc136c.tar.bz2 |
Use WeakValueDicts in the Memoizer to cut down on memory use.
Diffstat (limited to 'src/engine/SCons/Executor.py')
-rw-r--r-- | src/engine/SCons/Executor.py | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/engine/SCons/Executor.py b/src/engine/SCons/Executor.py index c58f82e..7965afe 100644 --- a/src/engine/SCons/Executor.py +++ b/src/engine/SCons/Executor.py @@ -176,6 +176,47 @@ class Executor: for tgt in self.targets: tgt.add_to_implicit(deps) + def get_missing_sources(self): + """ + __cacheable__ + """ + return filter(lambda s: s.missing(), self.sources) + + def get_source_binfo(self, calc): + """ + __cacheable__ + """ + calc_signature = lambda node, calc=calc: node.calc_signature(calc) + return map(lambda s, c=calc_signature: (s, c(s), str(s)), self.sources) + + + +class Null: + """A null Executor, with a null build Environment, that does + nothing when the rest of the methods call it. + + This might be able to disapper when we refactor things to + disassociate Builders from Nodes entirely, so we're not + going to worry about unit tests for this--at least for now. + """ + def get_build_env(self): + class NullEnvironment: + def get_scanner(self, key): + return None + return NullEnvironment() + def get_build_scanner_path(self): + return None + def __call__(self, *args, **kw): + pass + def cleanup(self): + pass + def get_missing_sources(self): + return [] + def get_source_binfo(self, calc): + return [] + + + if not SCons.Memoize.has_metaclass: _Base = Executor class Executor(SCons.Memoize.Memoizer, _Base): |