diff --git a/ChangeLog b/ChangeLog index 626f1a3..410dff3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2025-04-20 Bruno Haible + + Use an array-list instead of a linked-list of equiv.-classes, part 2. + * src/search.cc (Search::compute_partition): Fix a memory leak. + 2025-04-20 Bruno Haible Use a hash table in compute_partition, part 2. diff --git a/src/search.cc b/src/search.cc index 7d0651d..9b24356 100644 --- a/src/search.cc +++ b/src/search.cc @@ -1068,7 +1068,9 @@ Search::compute_partition (bool *undetermined) const { /* Allocate a new EquivalenceClass and add it as the last element to the partition. */ - pindex = partition->_equclasses.add_last (* new EquivalenceClass()); + char temp_storage[sizeof (EquivalenceClass)]; + EquivalenceClass * temp_equclass = new (temp_storage) EquivalenceClass (); + pindex = partition->_equclasses.add_last (* temp_equclass); /* Map this keyword (and all equivalent ones that will be seen later) to the equivalence class number pindex. */