From: Tom Tromey Date: Sat, 28 Dec 2013 05:22:07 +0000 (-0700) Subject: rearrange struct value to save memory X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=98b1cfdcc8998ad3e35896ade0fdba04ceda8d74;p=binutils-gdb.git 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 * value.c (struct value) : Move earlier. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b8659306fbb..6899c340ad2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2014-01-16 Tom Tromey + + * value.c (struct value) : Move earlier. + 2014-01-16 Tom Tromey * remote.c (extended_remote_create_inferior): Rename from diff --git a/gdb/value.c b/gdb/value.c index 8542316d51e..0e13b763a81 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;