mirror of
https://git.savannah.gnu.org/git/gperf.git
synced 2025-12-02 13:09:22 +00:00
Use an array-list instead of a linked-list of equiv.-classes, part 2.
* src/search.cc (Search::compute_partition): Fix a memory leak.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2025-04-20 Bruno Haible <bruno@clisp.org>
|
||||||
|
|
||||||
|
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 <bruno@clisp.org>
|
2025-04-20 Bruno Haible <bruno@clisp.org>
|
||||||
|
|
||||||
Use a hash table in compute_partition, part 2.
|
Use a hash table in compute_partition, part 2.
|
||||||
|
|||||||
@@ -1068,7 +1068,9 @@ Search::compute_partition (bool *undetermined) const
|
|||||||
{
|
{
|
||||||
/* Allocate a new EquivalenceClass and add it as the last element to
|
/* Allocate a new EquivalenceClass and add it as the last element to
|
||||||
the partition. */
|
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)
|
/* Map this keyword (and all equivalent ones that will be seen later)
|
||||||
to the equivalence class number pindex. */
|
to the equivalence class number pindex. */
|
||||||
|
|||||||
Reference in New Issue
Block a user