Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Pedro Alves <palves@redhat.com>
Cc: Tom Tromey <tom@tromey.com>,  gdb-patches@sourceware.org
Subject: Re: [RFA] Handle dereferencing Rust trait objects
Date: Thu, 16 Nov 2017 23:26:00 -0000	[thread overview]
Message-ID: <87bmk19554.fsf@tromey.com> (raw)
In-Reply-To: <e143ccc5-094f-5322-2eb8-bb4ae6b3c4bb@redhat.com> (Pedro Alves's	message of "Thu, 16 Nov 2017 16:34:59 +0000")

>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Pedro> std::unordered_map + pointers (or really small objects) makes me
Pedro> cry.  :-)  That has nasty memory overhead/footprint, with
Pedro> unordered_map being a node container...

I could do something else.  A vector of pairs, sorted by address; or an
htab_t.

Pedro> Can you say something about the number of elements that usually
Pedro> ends up in this map in some reasonably sized Rust-using app (Firefox?)?

I will look at this tomorrow.

Pedro> I'm assuming that you end up with many contiguous symbols pointing to
Pedro> the same psymtab?  Would an addrmap (addrmap.h/c) be a good fit here?
Pedro> Maybe not if we don't have the size of the psymbols handy when
Pedro> we build this...  :-/

Yes, the size isn't known, because psymtab reading doesn't really look
at the types.

Maybe an addrmap wouldn't be too bad though.  Perhaps I'll try a couple
of ideas and try to see what uses the least memory.

Pedro> This reinterpret_cast looks like a big hammer here.  Why not
Pedro> static_cast?

I changed it.  Not sure why I had that .. maybe leftover from before I
used derivation.

Pedro> A symbol can't be both is_cplus_template_function and is_rust_vtable,
Pedro> I think it'd be better long term if we merged the tag to a single
Pedro> enum bitfield (with two bits).  But it's not that big a deal and
Pedro> can always be done later.

I can do this.

Tom


  reply	other threads:[~2017-11-16 23:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-15 21:24 Tom Tromey
2017-11-15 21:28 ` Tom Tromey
2017-11-16 16:40   ` Pedro Alves
2017-11-16 23:13     ` Tom Tromey
2017-11-17 15:39       ` Pedro Alves
2017-11-16 16:35 ` Pedro Alves
2017-11-16 23:26   ` Tom Tromey [this message]
2017-11-17 17:30     ` Tom Tromey

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=87bmk19554.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /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