Yes, allocating the exact size would make the realloc unnecessary. But it
involve more code to walk one more time through the mask_reg and prio_reg
array before allocating.
I made it this way to make code shorter.
The freed MemoryRegion are not initialized at all.
However as realloc seems to be a
On 11/17/2011 02:56 PM, Peter Maydell wrote:
> 2011/11/17 Benoît Canet :
> > Signed-off-by: Benoit Canet
> > --- a/hw/sh7750.c
> > +++ b/hw/sh7750.c
> > @@ -756,7 +756,7 @@ SH7750State *sh7750_init(CPUSH4State * cpu,
> > MemoryRegion *sysmem)
> > "cache-and-tlb", 0x08000
2011/11/17 Benoît Canet :
> Signed-off-by: Benoit Canet
> --- a/hw/sh7750.c
> +++ b/hw/sh7750.c
> @@ -756,7 +756,7 @@ SH7750State *sh7750_init(CPUSH4State * cpu, MemoryRegion
> *sysmem)
> "cache-and-tlb", 0x0800);
> memory_region_add_subregion(sysmem, 0xf000,
Signed-off-by: Benoit Canet
---
hw/sh7750.c |2 +-
hw/sh_intc.c| 87 ++
hw/sh_intc.h|7 +++-
target-sh4/helper.c |3 ++
4 files changed, 68 insertions(+), 31 deletions(-)
diff --git a/hw/sh7750.c b/hw/sh7750.c