[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 29/61] ui/curses: Move arrays to .heap to save 74KiB of .bss
From: |
Paolo Bonzini |
Subject: |
[PULL 29/61] ui/curses: Move arrays to .heap to save 74KiB of .bss |
Date: |
Mon, 16 Mar 2020 22:26:56 +0100 |
From: Philippe Mathieu-Daudé <address@hidden>
We only need these arrays when using the curses display.
Move them from the .bss to the .heap (sizes reported on
x86_64 host: screen[] is 64KiB, vga_to_curses 7KiB).
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
ui/curses.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/ui/curses.c b/ui/curses.c
index 3bafc10..a59b23a 100644
--- a/ui/curses.c
+++ b/ui/curses.c
@@ -54,13 +54,13 @@ enum maybe_keycode {
};
static DisplayChangeListener *dcl;
-static console_ch_t screen[160 * 100];
+static console_ch_t *screen;
static WINDOW *screenpad = NULL;
static int width, height, gwidth, gheight, invalidate;
static int px, py, sminx, sminy, smaxx, smaxy;
static const char *font_charset = "CP437";
-static cchar_t vga_to_curses[256];
+static cchar_t *vga_to_curses;
static void curses_update(DisplayChangeListener *dcl,
int x, int y, int w, int h)
@@ -405,6 +405,8 @@ static void curses_refresh(DisplayChangeListener *dcl)
static void curses_atexit(void)
{
endwin();
+ g_free(vga_to_curses);
+ g_free(screen);
}
/*
@@ -783,6 +785,8 @@ static void curses_display_init(DisplayState *ds,
DisplayOptions *opts)
if (opts->u.curses.charset) {
font_charset = opts->u.curses.charset;
}
+ screen = g_new0(console_ch_t, 160 * 100);
+ vga_to_curses = g_new0(cchar_t, 256);
curses_setup();
curses_keyboard_setup();
atexit(curses_atexit);
--
1.8.3.1
- [PULL 21/61] i386: Fix GCC warning with snprintf when HAX is enabled, (continued)
- [PULL 21/61] i386: Fix GCC warning with snprintf when HAX is enabled, Paolo Bonzini, 2020/03/16
- [PULL 20/61] qom/object: Use common get/set uint helpers, Paolo Bonzini, 2020/03/16
- [PULL 22/61] WHPX: Use proper synchronization primitives while processing, Paolo Bonzini, 2020/03/16
- [PULL 23/61] Makefile: Align 'help' target output, Paolo Bonzini, 2020/03/16
- [PULL 24/61] Makefile: Let the 'help' target list the tools targets, Paolo Bonzini, 2020/03/16
- [PULL 25/61] hw/audio/fmopl: Move ENV_CURVE to .heap to save 32KiB of .bss, Paolo Bonzini, 2020/03/16
- [PULL 26/61] hw/audio/intel-hda: Use memory region alias to reduce .rodata by 4.34MB, Paolo Bonzini, 2020/03/16
- [PULL 27/61] hw/usb/quirks: Use smaller types to reduce .rodata by 10KiB, Paolo Bonzini, 2020/03/16
- [PULL 28/61] ui/curses: Make control_characters[] array const, Paolo Bonzini, 2020/03/16
- [PULL 32/61] Use -isystem for linux-headers dir, Paolo Bonzini, 2020/03/16
- [PULL 29/61] ui/curses: Move arrays to .heap to save 74KiB of .bss,
Paolo Bonzini <=
- [PULL 31/61] softmmu/vl.c: Handle '-cpu help' and '-device help' before 'no default machine', Paolo Bonzini, 2020/03/16
- [PULL 33/61] exec/rom_reset: Free rom data during inmigrate skip, Paolo Bonzini, 2020/03/16
- [PULL 36/61] lockable: add QemuRecMutex support, Paolo Bonzini, 2020/03/16
- [PULL 40/61] scripts/cocci: Patch to replace memory_region_init_{ram, readonly -> rom}, Paolo Bonzini, 2020/03/16
- [PULL 35/61] lockable: add lock guards, Paolo Bonzini, 2020/03/16
- [PULL 42/61] hw/display: Use memory_region_init_rom() with read-only regions, Paolo Bonzini, 2020/03/16
- [PULL 30/61] qemu-cpu-models.rst: Document -noTSX, mds-no, taa-no, and tsx-ctrl, Paolo Bonzini, 2020/03/16
- [PULL 34/61] cpus: avoid pause_all_vcpus getting stuck due to race, Paolo Bonzini, 2020/03/16
- [PULL 37/61] memory: Correctly return alias region type, Paolo Bonzini, 2020/03/16
- [PULL 38/61] memory: Simplify memory_region_init_rom_nomigrate() to ease review, Paolo Bonzini, 2020/03/16