From 8240da6cb3ff95ad480efe3e1876104024398fae Mon Sep 17 00:00:00 2001 From: Chantry Xavier Date: Sat, 12 Jan 2008 21:28:22 +0100 Subject: libalpm/cache.c : don't duplicate packages in pkgcache. Edit _alpm_db_add_pkgincache to not duplicate packages, because this is not needed, is slower, and uses more memory. This made the max memory usage during base reinstall go from 10.4MB to 9.7MB. Signed-off-by: Chantry Xavier Signed-off-by: Dan McGee --- lib/libalpm/trans.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/libalpm/trans.c') diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index ecc40a0f..52dbe7a9 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -253,7 +253,8 @@ void _alpm_trans_free(pmtrans_t *trans) FREELIST(trans->targets); if(trans->type == PM_TRANS_TYPE_SYNC) { alpm_list_free_inner(trans->packages, (alpm_list_fn_free)_alpm_sync_free); - } else { + } else if (trans->type == PM_TRANS_TYPE_REMOVE || + trans->type == PM_TRANS_TYPE_REMOVEUPGRADE) { alpm_list_free_inner(trans->packages, (alpm_list_fn_free)_alpm_pkg_free); } alpm_list_free(trans->packages); -- cgit v1.2.3-24-g4f1b