[pacman-dev] [PATCH] _alpm_db_add_pkgincache rework

Dan McGee dpmcgee at gmail.com
Tue Jul 15 20:18:10 EDT 2008


On Tue, Jul 15, 2008 at 1:37 AM, Xavier <shiningxc at gmail.com> wrote:
> Nagy Gabor wrote:
>>>From 7490b62443a0bd08a06fa3c97976a27de5b85665 Mon Sep 17 00:00:00 2001
>> From: Nagy Gabor <ngaba at bibl.u-szeged.hu>
>> Date: Tue, 15 Jul 2008 01:07:22 +0200
>> Subject: [PATCH] _alpm_db_add_pkgincache rework
>>
>> Commit 8240da6cb3ff95ad480efe3e1876104024398fae broke some alpm hierarchy
>> and introduced a new memleak (trans->packages was never freed in case of add
>> transaction, even if the transaction wasn't committed), so it is reverted
>> now.
>>
>> We follow a different approach to reduce memory usage:
>> _alpm_db_add_pkgincache doesn't duplicate the whole package before adding
>> it to the cache, only the package name and version (INFRQ_BASE).
>> This method needs very small extra memory (compared to the reverted method),
>> and after transaction commit we use less memory than before (since the
>> big 'files' fields are not copied to cache), this is useful in GUIs.
>>
>> Note: The old add_pkgincache was a bit broken, since pkg->origin wasn't
>> filled in correctly.
>>
>> Signed-off-by: Nagy Gabor <ngaba at bibl.u-szeged.hu>
>
> Acked-by: Xavier Chantry <shiningxc at gmail.com>

Now we just need to get rid of this silly REMOVEUPGRADE business
completely. Applied, thanks.

-Dan




More information about the pacman-dev mailing list