[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[lintian] 01/01: lintian/proc group: Explicitly initialise the shared cache



This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository lintian.

commit b7cb6bd55ed9a2ff675a82ceed32c4deae24a56a
Author: Niels Thykier <niels@thykier.net>
Date:   Fri Jul 17 23:38:15 2015 +0200

    lintian/proc group: Explicitly initialise the shared cache
    
    Previously, the shared cache was not initialised until a group based
    analysis.  Any data extracted by checks run prior to that would not
    use the new shared cache.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 frontend/lintian                |  1 +
 lib/Lintian/ProcessableGroup.pm | 14 ++++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/frontend/lintian b/frontend/lintian
index 6f67f5c..7414158 100755
--- a/frontend/lintian
+++ b/frontend/lintian
@@ -858,6 +858,7 @@ foreach my $gname (sort $pool->get_group_names()) {
         debug_msg(1, "Unpack of $gname done$tres");
         perf_log("$gname,total-group-unpack,${raw_res}");
         if ($action eq 'check') {
+            $group->init_shared_cache;
             if (!process_group($gname, $group)) {
                 $success = 0;
             }
diff --git a/lib/Lintian/ProcessableGroup.pm b/lib/Lintian/ProcessableGroup.pm
index 28e2fb4..b19e7fb 100644
--- a/lib/Lintian/ProcessableGroup.pm
+++ b/lib/Lintian/ProcessableGroup.pm
@@ -310,6 +310,20 @@ sub info {
     return $info;
 }
 
+=item $group->init_shared_cache
+
+Prepare a shared memory cache for all current members of the group.
+This is solely a memory saving optimisation and is not required for
+correct performance.
+
+=cut
+
+sub init_shared_cache {
+    my ($self) = @_;
+    $self->info; # Side-effect of creating the info object.
+    return;
+}
+
 =item $group->clear_cache
 
 Discard the info element of all members of this group, so the memory

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: