From: Daniel Jacobowitz <drow@false.org>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: RFC: save lots of memory
Date: Thu, 05 Nov 2009 19:59:00 -0000 [thread overview]
Message-ID: <20091105195948.GA17864@caradoc.them.org> (raw)
In-Reply-To: <m3ljil228l.fsf@fleche.redhat.com>
On Wed, Nov 04, 2009 at 06:23:54PM -0700, Tom Tromey wrote:
> Let me know what you think.
Generally seems sound. There are two things I noticed:
* I don't think passing length == -1 is inherently ugly as a flag.
But it does seem silly to not pass the length when we often know it in
the caller.
* I can save you a couple more bytes:
> + *slot = obstack_alloc (&objfile->objfile_obstack,
> + sizeof (struct demangled_name_entry)
> + + demangled_len);
You want offsetof here, not sizeof. The struct will have either three
or seven bytes of padding on most platforms, so you're pushing out to
a word boundary unnecessarily.
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2009-11-05 19:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-05 1:24 Tom Tromey
2009-11-05 17:28 ` Joel Brobecker
2009-12-27 3:40 ` Joel Brobecker
2009-11-05 19:59 ` Daniel Jacobowitz [this message]
2009-11-06 18:20 ` Tom Tromey
2009-11-06 19:23 ` Paul Pluzhnikov
2009-11-06 20:50 ` Tom Tromey
2009-11-16 18:41 ` Tom Tromey
2009-11-16 22:14 ` 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=20091105195948.GA17864@caradoc.them.org \
--to=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=tromey@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