From: Tom Tromey <tromey@redhat.com>
To: gdb-patches@sourceware.org
Subject: RFA: shrink macro_definition
Date: Sat, 23 Aug 2008 17:45:00 -0000 [thread overview]
Message-ID: <m3od3jeidt.fsf@fleche.redhat.com> (raw)
This patch shrinks struct macro_definition on 32-bit machines.
It has no size effect on 64-bit machines.
I compiled cc1 with -g3. Then I ran "gdb -readnow cc1" and "maint
space 1".
Before the change, gdb used 209219584 bytes.
After the change, gdb used 201326592 bytes.
That is a savings of 7 megabytes, or 3.77% of memory.
Built & regtested on x86-64 (compile farm).
Ok?
Tom
:ADDPATCH macros:
2008-08-23 Tom Tromey <tromey@redhat.com>
* macrotab.h (struct macro_definition) <kind>: Shrink to one bit.
(argc): Now 31 bits.
diff --git a/gdb/macrotab.h b/gdb/macrotab.h
index 5ff36ea..71f1d3e 100644
--- a/gdb/macrotab.h
+++ b/gdb/macrotab.h
@@ -269,12 +269,12 @@ struct macro_definition
struct macro_table *table;
/* What kind of macro it is. */
- enum macro_kind kind;
+ ENUM_BITFIELD (macro_kind) kind : 1;
/* If `kind' is `macro_function_like', the number of arguments it
takes, and their names. The names, and the array of pointers to
them, are in the table's bcache, if it has one. */
- int argc;
+ int argc : 31;
const char * const *argv;
/* The replacement string (body) of the macro. This is in the
next reply other threads:[~2008-08-23 17:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-23 17:45 Tom Tromey [this message]
2008-08-23 20:20 ` Daniel Jacobowitz
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=m3od3jeidt.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@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