From f7dec19f5ce3b876c5d2eaeb2d26cf513780c935 Mon Sep 17 00:00:00 2001 From: Daniel Burrows Date: Thu, 25 Sep 2008 18:24:09 -0700 Subject: Restore the apt ABI. The problem was that the size of pkgDpkgPM and its member offsets changed because a map giving the names of the trigger states was inserted into the middle of the structure. I fixed it by using a statically allocated array instead. This changes the procedure for looking up a string to a linear search, which should be fine (or even faster than before) since there are only 4 state strings. If it becomes a problem, sorting the array by key will allow us to use std::equal_range(), but I would advise against this unless it's really necessary, since sooner or later someone will forget to maintain the sort order. --- debian/changelog | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 5c381ab27..8913ef4bf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +apt (UNRELEASED) experimental; urgency=low + + [Daniel Burrows] + * apt-pkg/deb/dpkgpm.cc: + - Store the trigger state descriptions in a way that does not break + the ABI. The approach taken makes the search for a string O(n) rather + than O(lg(n)), but since n == 4, I do not consider this a major + concern. If it becomes a concern, we can sort the static array and + use std::equal_range(). (Closes: #499322) + + -- + apt (0.7.15~exp2) experimental; urgency=low [ Michael Vogt ] -- cgit v1.2.3