summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Taskmaster.py
diff options
context:
space:
mode:
authorDirk Baechle <dl9obn@darc.de>2013-12-19 20:27:00 (GMT)
committerDirk Baechle <dl9obn@darc.de>2013-12-19 20:27:00 (GMT)
commit4bbec153e3cb22fccb8c67212af1894f245bd8f8 (patch)
treedf9bc10f1461930597339c0a26d290d46e81c5dd /src/engine/SCons/Taskmaster.py
parent49f23291e62a741a5f53a3e37f606588a2e0d2f0 (diff)
downloadSCons-4bbec153e3cb22fccb8c67212af1894f245bd8f8.zip
SCons-4bbec153e3cb22fccb8c67212af1894f245bd8f8.tar.gz
SCons-4bbec153e3cb22fccb8c67212af1894f245bd8f8.tar.bz2
Added release_target_info() to File nodes, reduces memory consumption.
Diffstat (limited to 'src/engine/SCons/Taskmaster.py')
-rw-r--r--src/engine/SCons/Taskmaster.py37
1 files changed, 27 insertions, 10 deletions
diff --git a/src/engine/SCons/Taskmaster.py b/src/engine/SCons/Taskmaster.py
index 64ab84d..5de1cda 100644
--- a/src/engine/SCons/Taskmaster.py
+++ b/src/engine/SCons/Taskmaster.py
@@ -186,6 +186,8 @@ class Task(object):
# or implicit dependencies exists, and also initialize the
# .sconsign info.
executor = self.targets[0].get_executor()
+ if executor is None:
+ return
executor.prepare()
for t in executor.get_action_targets():
if print_prepare:
@@ -289,6 +291,7 @@ class Task(object):
post-visit actions that must take place regardless of whether
or not the target was an actual built target or a source Node.
"""
+ global print_prepare
T = self.tm.trace
if T: T.write(self.trace_message('Task.executed_with_callbacks()',
self.node))
@@ -301,7 +304,12 @@ class Task(object):
if not t.cached:
t.push_to_cache()
t.built()
- t.visited()
+ t.visited()
+ if (not print_prepare and
+ (not hasattr(self, 'options') or not self.options.debug_includes)):
+ t.release_target_info()
+ else:
+ t.visited()
executed = executed_with_callbacks
@@ -382,6 +390,7 @@ class Task(object):
This is the default behavior for building only what's necessary.
"""
+ global print_prepare
T = self.tm.trace
if T: T.write(self.trace_message(u'Task.make_ready_current()',
self.node))
@@ -414,6 +423,9 @@ class Task(object):
# parallel build...)
t.visited()
t.set_state(NODE_UP_TO_DATE)
+ if (not print_prepare and
+ (not hasattr(self, 'options') or not self.options.debug_includes)):
+ t.release_target_info()
make_ready = make_ready_current
@@ -453,14 +465,15 @@ class Task(object):
parents[p] = parents.get(p, 0) + 1
for t in targets:
- for s in t.side_effects:
- if s.get_state() == NODE_EXECUTING:
- s.set_state(NODE_NO_STATE)
- for p in s.waiting_parents:
- parents[p] = parents.get(p, 0) + 1
- for p in s.waiting_s_e:
- if p.ref_count == 0:
- self.tm.candidates.append(p)
+ if t.side_effects is not None:
+ for s in t.side_effects:
+ if s.get_state() == NODE_EXECUTING:
+ s.set_state(NODE_NO_STATE)
+ for p in s.waiting_parents:
+ parents[p] = parents.get(p, 0) + 1
+ for p in s.waiting_s_e:
+ if p.ref_count == 0:
+ self.tm.candidates.append(p)
for p, subtract in parents.items():
p.ref_count = p.ref_count - subtract
@@ -927,7 +940,11 @@ class Taskmaster(object):
if node is None:
return None
- tlist = node.get_executor().get_all_targets()
+ executor = node.get_executor()
+ if executor is None:
+ return None
+
+ tlist = executor.get_all_targets()
task = self.tasker(self, tlist, node in self.original_top, node)
try: