Age | Commit message (Collapse) | Author | Files | Lines |
|
- Transaction preparation fingerprinting now shares all the strings from
rpmfi's etc. Rpmdb basename iterator still needs a private pool
as there's nowhere to get a pool handle (for now at least).
- We no longer need to (and actually we couldn't) freeze the
pool before fingerprinting.
|
|
- Both callers updated to still use a private pool so no practical
change here.
|
|
|
|
- <gulp> but no anomalies noted by test-suite, valgrind or
a bit of manual testing. Time will tell...
- Memory is no longer scarce or scary, the strings are simply owned
by the pool in all circumstances. Eliminate scareMemory foobar
from the fingerprinting internals.
|
|
- For now we're doing a fair amount of extra work and wasting memory
as data is in different pools so we need to copy to get the strings
and ids into our private pool. This will go away later.
|
|
- This is fairly straightforward (or supposed to be...) especially
now that its all hidden behind APIs. Note that we no longer bother
precalculating the hash as a pool-id's hash is a no-cost operation,
for strings it was far more expensive.
|
|
|
|
- rpmfi cannot know anything about the storage, so rpmfiFpxIndex()
cannot be... change it to rpmfiFps() which only returns the pointer
we got from fpLookupList()
- Change fpCacheGetByFp() to assume it gets passed an array of fps,
and take an additional index argument. Return the fingerprint
pointer on success, NULL on not found to allow further operations
on the fp without knowing its internals.
|
|
- If the fingerprint pointer passed to it is NULL then allocate space
for a new fingerprint, otherwise reuse the previous space. This should
allow optimizing the case where repeatedly calling and directory
doesn't change inside fpc so callers dont need special-case code
for this. For now, we dont care about optimizations, other than
making it possible later.
|
|
- Only disk-space calculations need the actual entry contents, add
getter for dir name and device. We're passing the cache to these
getters too: its not currently unusedd but will be needed for
directory name pool id->string translation once we get there...
|
|
|
|
- Eliminates one place where knowledge about fingerprint internals
has been needed, now rpmfi just gets (an supposedly) opaque blob back.
|
|
- Replace the direct hackery in rpmdb internals with a little less
direct hackery...
|
|
- fprint.h only needs rpmtypes.h now, remove historical leftovers
- Avoids having to define the hash types multiple times as they're
now buried out of sight
- fpHashFunction() and fpLookupSubdir() can now be made static, do so...
|
|
- Rename addFingerprints() to fpCachePopulate() and move into fprint.c.
This doesn't really belong here as it requires fprint becoming aware
of transactions and all, but at least these are all controlled API
accesses unlike where in transaction.c this was messing with somebody
elses data structures directly.
- Move the by-fingerprint creation to fpCachePopulate() so it gets
lazily done as needed and copy the original hash-size heuristics
back here.
|
|
- For now, always create the by-fingerprint hash although rpmdb usage
doesn't need it. Next steps will fix...
- Add wrapper API for retrieving the records, adjust callers
- No functional changes, at least intended ones... just first steps
towards eliminating the hash-jungle and forcing a single API
through which this stuff gets handled
|
|
- Not that it matters much when everything else is wide open but gotta
start with something...
|
|
- Instead of adding three more pool-aware versions of the old API's,
convert the main callers to the newew more flexible API. As a
"minor side-effect" these now use the transaction string-pool as well,
so ALL our pre-transaction dependency sets are now using the global
pool.
|
|
- These all do more or less the same thing, easily handled with a common
function that takes a couple of more extra parameters. The old variants
become just wrappers to call the pool-aware rpmdsMatches() with suitable
arguments.
|
|
- This wasn't possible with the former static rpmlib() dependency set
as it would've kept the potentially huge global pool referenced
throughout process lifetime.
|
|
|
|
- Eliminates the cumbersome static rpmlib ds instance which can never
be freed, as a member of the transaction set it simply gets cleaned
out along with other transaction (dependency) data.
|
|
|
|
|
|
|
|
- Pooh ... I mean pool ... bah. The previous versions become simple
wrappers to the pool-aware ones, using a private pool always.
rpmdsCurrent() doesn't need pool-variant as its inherits its pool
from the parent.
|
|
- Eliminate the pre-created pool wtf'ery (what was I thinking?), just
create a ds with zero id's and fill them up once we have the ds.
|
|
- The dependency sets created from installed headers during rpmtsCheck()
were using a private pool and thus ids not matching with the ones
in the global pool. Oops. Somehow none of our test-suite cases
caught this, looks like we'll need more tests... Also the safe-guard
assert()'s are in all the wrong places for catching this particular
problem. Doh :)
- There's a chicken-and-egg situation involved: in order to do this,
the global pool needs to be in unfrozen state during rpmtsCheck(),
which was not possible before switching rpmal provides (and files)
to pool ids. Now that it *is* using pool id's, move the freeze-point
to rpmtsPrepare() as the fingerprinting has similar issues with
moving strings.
|
|
|
|
|
|
|
|
- Pool id -> string always works with a frozen pool, but in some cases
we'll need to go the other way, allow caller to specify whether
string -> id lookups should be possible on frozen pool.
- On glibc, realloc() to smaller size doesn't move the data but on
other platforms (including valgrind) it can and does move, which
would require a full rehash. For now, just leave all the data
alone unless we're also freeing the hash, the memory savings
isn't much for a global pool (which is where this matters)
|
|
|
|
|
|
|
|
- With this, practically all transaction member file (base- and dirname)
and dependency strings get now stored in a giant transaction global
string pool. Greenpeace applaudes us for all the rain-forests that
will be saved by the memory savings... not. Some memory is saved
but the real wins only start when everything is converted to use
pool id's instead of string pointers. Also we're still creating
a ridiculous number of private pools from various sources, but
we gotta start someplace.
|
|
- Add a pool pointer to to ts members struct and a getter function
- Grab the global pool for rpmte dependency- and file info creation,
if its NULL then the sets will use private pools of their own.
- Add the (currently) required magic voodoo rain-dance to freeze and
unfreeze the pool as necessary wrt new element additions: for
current rpmal and fingerprinting to work, the string pointers
must be immovable.
- This is infrastructure only: nothing creates the global pool yet,
so everything is still using private pools.
|
|
|
|
- We're not using the added rpmal for anything before rpmtsCheck() and/or
rpmtsOrder(), so this shouldn't break anything either. This is probably
a more or less temporary setup to make string pointer -> pool id
transition a bit easier.
|
|
- We'll need this shortly for added packages too...
|
|
|
|
- rpmdsNewPool() allows specifying shared/private pool, and rpmdsNew()
is now just a wrapper to always call it with NULL (ie private) pool.
|
|
- ...to avoid wasting memory on the relatively static data. We could
handle the rpmlib ds singleton behavior here too but it would change
semantics. Ponder about it later...
- Would be nicer to have rpmdsMerge() freeze on return, but that
gets called in loops so we'd be doing a whole lot of huffing and
puffing recreating the pools on each entry.
|
|
- Allow rpmdsCurrent() to share the pool and id's of its "parent" ds
instead of having to repeatedly create and tear down entire pools
just for a couple of strings. Used by python bindings for rpmds
iteration so we'll want to be reasonably efficient.
- For now, rpmdsSingle() and rpmdsThis() always get a private pool,
wasteful as it might be, but at least now we can freeze them.
|
|
- No functional changes, just sanity-refactoring
|
|
- These "can't happen" cases where EVR/Flags in source ds are missing
are just as easy to handle as is dying, handling is saner...
|
|
- The "can't happen" case where EVR/Flags are not present is just as
easily handled as dying.
|
|
- Always push dependency names and versions into string pool (private
for now). This is terribly wasteful for single ds items, even more
so for rpmdsCurrent() but to keep the initial switch-over changes
to minimum we'll deal with those later.
- While we freeze the pool for ds data from headers, single ds items
are on purpose not frozen for now, due to interactions with
rpmdsCurrent() and rpmds merging.
- Eliminate no longer needed rpmdsDupArgv(), we're now just copying
a bunch of integers around. Sanitize rpmdsMerge() now that we can:
realloc and shift the data instead of recreating all of N, EVR
and Flags.
|
|
- Using rpmtd iteration for this is slow and stupid as we keep
pointlessly re-re-re-re-re-validating the tag type and indexes.
- Change argument order to source -> destination
- Move to rpmtd.c where it belongs and make public with a decent
name. Not sure if this is the kind of an API we really want to make
public but ... at least for now it'll do.
|
|
|