public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Matthias Maennich <maennich@google.com>
To: libabigail@sourceware.org
Cc: dodji@seketeli.org, gprocida@google.com, kernel-team@android.com,
	 maennich@google.com
Subject: [PATCH 3/5] XML writer: track emitted types by bare pointer
Date: Fri,  3 Dec 2021 11:46:21 +0000	[thread overview]
Message-ID: <20211203114622.2944173-4-maennich@google.com> (raw)
In-Reply-To: <20211203114622.2944173-1-maennich@google.com>

This is a performance and safety improvement made possible by the
previous changes which ensure that the same pointers are inserted and
looked up.

This essentially removes the now unnecessary deep comparison.

	* src/abg-writer.cc (type_ptr_set_type): Change typedef
	container type to use default equality and hashing for pointer
	keys.
	(fn_type_ptr_set_type): Likewise.

Reviewed-by: Giuliano Procida <gprocida@google.com>
Signed-off-by: Matthias Maennich <maennich@google.com>
---
 src/abg-writer.cc | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/abg-writer.cc b/src/abg-writer.cc
index 4cf2a7fb16af..d2ef19eb7095 100644
--- a/src/abg-writer.cc
+++ b/src/abg-writer.cc
@@ -123,14 +123,10 @@ typedef unordered_map<type_base*,
 		      abigail::diff_utils::deep_ptr_eq_functor> type_ptr_map;
 
 // A convenience typedef for a set of type_base*.
-typedef unordered_set<const type_base*, type_hasher,
-		      abigail::diff_utils::deep_ptr_eq_functor>
-type_ptr_set_type;
+typedef std::unordered_set<const type_base*> type_ptr_set_type;
 
 /// A convenience typedef for a set of function type*.
-typedef unordered_set<function_type*, type_hasher,
-		      abigail::diff_utils::deep_ptr_eq_functor>
-fn_type_ptr_set_type;
+typedef std::unordered_set<function_type*> fn_type_ptr_set_type;
 
 typedef unordered_map<shared_ptr<function_tdecl>,
 		      string,
-- 
2.34.1.400.ga245620fadb-goog


  parent reply	other threads:[~2021-12-03 12:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-03 11:46 [PATCH 0/5] Improvements for the XML Writer Matthias Maennich
2021-12-03 11:46 ` [PATCH 1/5] XML writer: use consistent type pointers for type ids and emission tracking Matthias Maennich
2021-12-09 17:57   ` Dodji Seketeli
2021-12-03 11:46 ` [PATCH 2/5] XML writer: use exemplar types for tracking referenced types Matthias Maennich
2021-12-10 10:42   ` Dodji Seketeli
2021-12-03 11:46 ` Matthias Maennich [this message]
2021-12-10 10:50   ` [PATCH 3/5] XML writer: track emitted types by bare pointer Dodji Seketeli
2021-12-16 16:07     ` Matthias Maennich
2022-01-10 17:00       ` Dodji Seketeli
2022-01-17 18:03         ` Matthias Maennich
2022-01-18 17:15   ` Dodji Seketeli
2021-12-03 11:46 ` [PATCH 4/5] XML writer: map type ids " Matthias Maennich
2022-01-19 10:12   ` Dodji Seketeli
2021-12-03 11:46 ` [PATCH 5/5] XML writer: resolve declaration-only enum definitions Matthias Maennich
2022-01-19 10:38   ` Dodji Seketeli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211203114622.2944173-4-maennich@google.com \
    --to=maennich@google.com \
    --cc=dodji@seketeli.org \
    --cc=gprocida@google.com \
    --cc=kernel-team@android.com \
    --cc=libabigail@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).