From ad37168cbdaff061fd7c37be57de4692bd8c2c50 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Wed, 11 Jun 2014 12:19:25 +0200 Subject: vga: do not dynamically allocate chain4_alias Instead, add a boolean variable to indicate the presence of the region. This avoids a repeated malloc/free (later we can also avoid the add_child/unparent by changing the offset/size of the alias). Reviewed-by: Peter Crosthwaite Signed-off-by: Paolo Bonzini --- hw/display/vga_int.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hw/display/vga_int.h') diff --git a/hw/display/vga_int.h b/hw/display/vga_int.h index 5320abdc07..641f8f41d2 100644 --- a/hw/display/vga_int.h +++ b/hw/display/vga_int.h @@ -94,7 +94,8 @@ typedef struct VGACommonState { uint32_t vram_size; uint32_t vram_size_mb; /* property */ uint32_t latch; - MemoryRegion *chain4_alias; + bool has_chain4_alias; + MemoryRegion chain4_alias; uint8_t sr_index; uint8_t sr[256]; uint8_t gr_index; -- cgit v1.2.3