From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 22C8E138010 for ; Tue, 16 Oct 2012 15:55:48 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 90DDDE00E6; Tue, 16 Oct 2012 15:55:37 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 12D39E00E6 for ; Tue, 16 Oct 2012 15:55:37 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 722D833C3B4 for ; Tue, 16 Oct 2012 15:55:36 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 28849E5436 for ; Tue, 16 Oct 2012 15:55:34 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1350402922.e9fd283aedf54e2effc73f4157524fe9a26993c0.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/actions.py pym/_emerge/main.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: e9fd283aedf54e2effc73f4157524fe9a26993c0 X-VCS-Branch: master Date: Tue, 16 Oct 2012 15:55:34 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: bc36b1af-f617-4655-a907-3376472482c5 X-Archives-Hash: ec9be807779202ec8908332bab5df741 commit: e9fd283aedf54e2effc73f4157524fe9a26993c0 Author: Zac Medico gentoo org> AuthorDate: Tue Oct 16 15:55:22 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Tue Oct 16 15:55:22 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e9fd283a run_action: gc locals of calling func --- pym/_emerge/actions.py | 9 ++++++++- pym/_emerge/main.py | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index 3336e9f..c403d89 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -3426,7 +3426,14 @@ def repo_name_duplicate_check(trees): return bool(ignored_repos) -def run_action(settings, trees, mtimedb, myaction, myopts, myfiles): +def run_action(settings, trees, mtimedb, myaction, myopts, myfiles, + gc_locals=None): + + # The caller may have its local variables garbage collected, so + # they don't consume any memory during this long-running function. + if gc_locals is not None: + gc_locals() + gc_locals = None # skip global updates prior to sync, since it's called after sync if myaction not in ('help', 'info', 'sync', 'version') and \ diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py index fd1fd06..ef94a47 100644 --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@ -999,4 +999,5 @@ def emerge_main(args=None): tmpcmdline.extend(args) myaction, myopts, myfiles = parse_opts(tmpcmdline) - return run_action(settings, trees, mtimedb, myaction, myopts, myfiles) + return run_action(settings, trees, mtimedb, myaction, myopts, myfiles, + gc_locals=locals().clear)