This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
FYI: don't set TYPE_FIELD_IGNORE_BITS
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 27 Aug 2010 15:03:18 -0600
- Subject: FYI: don't set TYPE_FIELD_IGNORE_BITS
I'm checking this in.
While looking into other things I noticed that we set
TYPE_FIELD_IGNORE_BITS in dwarf2read.c, but we never actually set any
bit in the array.
This patch saves a tiny bit of memory by just not allocating this field.
Built and regtested on x86-64 (compile farm).
Tom
2010-08-27 Tom Tromey <tromey@redhat.com>
* dwarf2read.c (dwarf2_attach_fields_to_type): Don't set
TYPE_FIELD_IGNORE_BITS.
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.446
diff -u -r1.446 dwarf2read.c
--- dwarf2read.c 27 Aug 2010 16:37:03 -0000 1.446
+++ dwarf2read.c 27 Aug 2010 20:45:37 -0000
@@ -6266,9 +6266,9 @@
(B_TYPE *) TYPE_ALLOC (type, B_BYTES (nfields));
B_CLRALL (TYPE_FIELD_PROTECTED_BITS (type), nfields);
- TYPE_FIELD_IGNORE_BITS (type) =
- (B_TYPE *) TYPE_ALLOC (type, B_BYTES (nfields));
- B_CLRALL (TYPE_FIELD_IGNORE_BITS (type), nfields);
+ /* We don't set TYPE_FIELD_IGNORE_BITS here. The DWARF reader
+ never sets any bits in that array, so leaving it NULL lets us
+ save a little memory. */
}
/* If the type has baseclasses, allocate and clear a bit vector for