Commit Graph

9 Commits

Author SHA1 Message Date
Thierry Vignaud c080226a60 add short summaries to headers that miss one 2016-01-28 14:42:47 +01:00
Panu Matilainen cfe99e08ad Drop the end-of-chunk dummy entries from string pool
- As pointed out by Michael Schroeder in
  http://lists.rpm.org/pipermail/rpm-maint/2013-September/003605.html,
  the dummy entries used for optimizing rpmstrPoolStrlen() are
  problematic in number of ways:
  - Walking the id's in a pool is unreliable, and rehashing can cause
    bogus empty strings to be added to a pool where they otherwise
    do not exist
  - rpmstrPoolNumStr() is not accurate when more than one chunk is in use
- Unfortunately this means giving up the rpmstrPoolStrlen() optimization,
  for now at least.
2013-12-02 10:45:33 +02:00
Panu Matilainen 8da8842989 Add doxygen documentation to string pool API 2012-09-27 13:11:17 +03:00
Panu Matilainen f93162a702 Fixup string pool prototype argument names to match implementation
- Just a simple s/sidpool/pool/ to match the implementation, "sidpool"
  is a leftover from early draft version that somehow made its way
  to the master tree.
2012-09-27 12:18:39 +03:00
Panu Matilainen 1bbf25b78f Add function to get number of unique strings in the pool 2012-09-26 08:34:40 +03:00
Panu Matilainen 1e2c2fece2 Add a string equality check function to string pool API
- As a special case, two strings (ids) from the same pool can be tested for
  equality in constant time (integer comparison). If the pools differ,
  a regular string comparison is needed.
2012-09-13 09:01:30 +03:00
Panu Matilainen 0654685493 Allow keeping hash table around on pool freeze, adjust callers
- 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)
2012-09-12 19:17:20 +03:00
Panu Matilainen d2bb9d38c9 Move string pool typedefs to rpmtypes.h
- I suspect these will be used widely, to avoid having to include
  rpmstrpool.h all over in headers...
2012-09-07 14:09:35 +03:00
Panu Matilainen 9e47043b2d First cut of a libsolv-style string <-> id pool API
- The pool stores "arbitrary" number of strings in a space-efficient
  manner, with near constant (hashed) string -> id lookup/store and
  constant time id -> string and id -> string length lookups.
- Credits for the idea go to the Suse developers working on libsolv,
  the basic concept is directly lifted from there but details
  differ due to using rpm's own hash table implementation etc.
  Another minor difference is using size_t for offsets to permit over
  4GB total data size on 64bit systems, the total number of id's in
  the pool is limited to uint32 max however (like in libsolv).
- Any (re)implementation bugs by yours truly, this is almost certainly
  going to need further tuning and tweaking, API and otherwise.
2012-09-07 13:34:27 +03:00