aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-12-27 22:22:07 -0700
committerTom Tromey <tromey@redhat.com>2014-01-16 14:56:31 -0700
commit98b1cfdcc8998ad3e35896ade0fdba04ceda8d74 (patch)
treefc5cfeffc277830ab26c482ce56ddae9d5e6f271 /gdb/value.c
parent77a194459598886be9a0bf3e3bac0a11025ef208 (diff)
downloadgdb-98b1cfdcc8998ad3e35896ade0fdba04ceda8d74.zip
gdb-98b1cfdcc8998ad3e35896ade0fdba04ceda8d74.tar.gz
gdb-98b1cfdcc8998ad3e35896ade0fdba04ceda8d74.tar.bz2
rearrange struct value to save memory
This patch rearranges struct value a tiny bit, moving the "regnum" field into a hole. This saves 8 bytes per value on a 64-bit machine, and 4 bytes per value on a 32 bit machine. I think it does not negatively affect readability or performance. Built and regtested on x86-64 Fedora 18. 2014-01-16 Tom Tromey <tromey@redhat.com> * value.c (struct value) <regnum>: Move earlier.
Diffstat (limited to 'gdb/value.c')
-rw-r--r--gdb/value.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/value.c b/gdb/value.c
index 8542316..0e13b76 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -216,6 +216,9 @@ struct value
/* If the value has been released. */
unsigned int released : 1;
+ /* Register number if the value is from a register. */
+ short regnum;
+
/* Location of value (if lval). */
union
{
@@ -324,9 +327,6 @@ struct value
taken off this list. */
struct value *next;
- /* Register number if the value is from a register. */
- short regnum;
-
/* Actual contents of the value. Target byte-order. NULL or not
valid if lazy is nonzero. */
gdb_byte *contents;