Shrink size of dwarf2_per_cu_data
authorTom Tromey <tom@tromey.com>
Wed, 21 Apr 2021 22:10:44 +0000 (16:10 -0600)
committerTom Tromey <tom@tromey.com>
Wed, 21 Apr 2021 22:57:31 +0000 (16:57 -0600)
commit7e7a35fbca94c5bfe45781067c75671ba508a0c8
tree2df6aaa394da1f326582028063cbffeb10ca189a
parent6d5702a5eb313c8c3195edc21eebf6ef312a3fcc
Shrink size of dwarf2_per_cu_data

I noticed some holes in struct dwarf2_per_cu_data.  This patch
rearranges the type slightly, and shrinks the size of some fields.
This reduces it from 136 bytes to 112 bytes (on x86-64).

I also reduced the size of the DWARF "version" fields in a couple of
spots.  It seemed needless to use a short to hold a value that ranges
from 2 to 5, and this also helped the goal of shrinking
dwarf2_per_cu_data.

2021-04-21  Tom Tromey  <tom@tromey.com>

* dwarf2/read.h (struct dwarf2_per_cu_data) <dwarf_version>: Now
unsigned char.
(struct dwarf2_per_cu_data): Rearrange.
* dwarf2/comp-unit.h (struct comp_unit_head) <version>: Now
unsigned char.
(struct comp_unit_head): Rearrange.
* dwarf2/comp-unit.c (read_comp_unit_head): Update.
gdb/ChangeLog
gdb/dwarf2/comp-unit.c
gdb/dwarf2/comp-unit.h
gdb/dwarf2/read.h
This page took 0.040597 seconds and 4 git commands to generate.