Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* RFA: shrink macro_definition
@ 2008-08-23 17:45 Tom Tromey
  2008-08-23 20:20 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Tromey @ 2008-08-23 17:45 UTC (permalink / raw)
  To: gdb-patches

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: RFA: shrink macro_definition
  2008-08-23 17:45 RFA: shrink macro_definition Tom Tromey
@ 2008-08-23 20:20 ` Daniel Jacobowitz
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2008-08-23 20:20 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On Sat, Aug 23, 2008 at 11:44:14AM -0600, Tom Tromey wrote:
> :ADDPATCH macros:
> 
> 2008-08-23  Tom Tromey  <tromey@redhat.com>
> 
> 	* macrotab.h (struct macro_definition) <kind>: Shrink to one bit.
> 	(argc): Now 31 bits.

:REVIEWMAIL:

OK.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-08-23 20:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-23 17:45 RFA: shrink macro_definition Tom Tromey
2008-08-23 20:20 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox