Yes the size of struct grid_cell increased to add the underscore colour,
you must have a lot of extended cells.
It does seem a bit weird because it was 36 bytes and is now 40 for me,
which is not much of an increase, perhaps your compiler is packing it
very badly.
But we can pack it better, please try this and see if it helps:
Index: grid.c
===================================================================
RCS file: /cvs/src/usr.bin/tmux/grid.c,v
retrieving revision 1.96
diff -u -p -r1.96 grid.c
--- grid.c 27 Jun 2019 15:17:41 -0000 1.96
+++ grid.c 3 Jul 2019 16:49:45 -0000
@@ -37,12 +37,12 @@
/* Default grid cell data. */
const struct grid_cell grid_default_cell = {
- 0, 0, 8, 8, 0, { { ' ' }, 0, 1, 1 }
+ { { ' ' }, 0, 1, 1 }, 0, 0, 8, 8, 0
};
/* Cleared grid cell data. */
const struct grid_cell grid_cleared_cell = {
- GRID_FLAG_CLEARED, 0, 8, 8, 0, { { ' ' }, 0, 1, 1 }
+ { { ' ' }, 0, 1, 1 }, 0, GRID_FLAG_CLEARED, 8, 8, 0
};
static const struct grid_cell_entry grid_cleared_entry = {
GRID_FLAG_CLEARED, { .data = { 0, 8, 8, ' ' } }
Index: screen-write.c
===================================================================
RCS file: /cvs/src/usr.bin/tmux/screen-write.c,v
retrieving revision 1.154
diff -u -p -r1.154 screen-write.c
--- screen-write.c 27 Jun 2019 15:17:41 -0000 1.154
+++ screen-write.c 3 Jul 2019 16:49:45 -0000
@@ -36,7 +36,7 @@ static const struct grid_cell *screen_wr
const struct utf8_data *, u_int *);
static const struct grid_cell screen_write_pad_cell = {
- GRID_FLAG_PADDING, 0, 8, 8, 0, { { 0 }, 0, 0, 0 }
+ { { 0 }, 0, 0, 0 }, 0, GRID_FLAG_PADDING, 0, 8, 8
};
struct screen_write_collect_item {
Index: style.c
===================================================================
RCS file: /cvs/src/usr.bin/tmux/style.c,v
retrieving revision 1.22
diff -u -p -r1.22 style.c
--- style.c 1 Jul 2019 06:56:00 -0000 1.22
+++ style.c 3 Jul 2019 16:49:45 -0000
@@ -30,7 +30,7 @@
/* Default style. */
static struct style style_default = {
- { 0, 0, 8, 8, 0, { { ' ' }, 0, 1, 1 } },
+ { { { ' ' }, 0, 1, 1 }, 0, 0, 8, 8, 0 },
8,
STYLE_ALIGN_DEFAULT,
Index: tmux.h
===================================================================
RCS file: /cvs/src/usr.bin/tmux/tmux.h,v
retrieving revision 1.918
diff -u -p -r1.918 tmux.h
--- tmux.h 1 Jul 2019 06:56:00 -0000 1.918
+++ tmux.h 3 Jul 2019 16:49:45 -0000
@@ -596,13 +596,13 @@ enum utf8_state {
/* Grid cell data. */
struct grid_cell {
- u_char flags;
+ struct utf8_data data; /* 21 bytes */
u_short attr;
+ u_char flags;
int fg;
int bg;
int us;
- struct utf8_data data;
-};
+} __packed;
struct grid_cell_entry {
u_char flags;
union {