aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2014-03-05 10:42:00 +0000
committerSimon McVittie <smcv@debian.org>2014-03-05 10:42:20 +0000
commitc04a26f3e70d654ccec5542daf8425e44cb5bac8 (patch)
treefa60819656fd14829cab337f98232b8fedee67f9
parenta9fc30b19cfb68c1bd326e0088a677fc87c7dca5 (diff)
downloadikiwiki-c04a26f3e70d654ccec5542daf8425e44cb5bac8.tar
ikiwiki-c04a26f3e70d654ccec5542daf8425e44cb5bac8.tar.gz
Assume that every page has been scanned by the time the scan phase ends
This doesn't prevent memory from being used to track what we have and haven't scanned, but it does make it temporary. The existing %rendered hash, which is filled afterwards, will be larger than %scanned in practice anyway: %scanned will contain an entry for each page that changed, plus an entry for each template used by templatebody, whereas %rendered will contain an entry for each page that changed plus an entry for each page rendered due to links or dependencies.
-rw-r--r--IkiWiki/Render.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm
index c88de1e8e..825c077da 100644
--- a/IkiWiki/Render.pm
+++ b/IkiWiki/Render.pm
@@ -154,7 +154,7 @@ sub genpage ($$) {
sub scan ($) {
my $file=shift;
- return if $scanned{$file};
+ return if $phase > PHASE_SCAN || $scanned{$file};
$scanned{$file}=1;
debug(sprintf(gettext("scanning %s"), $file));
@@ -883,6 +883,9 @@ sub refresh () {
# At this point it becomes OK to start matching pagespecs.
$phase = PHASE_RENDER;
+ # Save some memory: we no longer need to keep track of which pages
+ # we've scanned
+ %scanned = ();
remove_del(@$del, @$internal_del);