mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
ppc/pnv: Instantiate cores separately
Allocating a big void * array to store multiple objects isn't a recommended practice for various reasons: - no compile time type checking - potential dangling pointers if a reference on an individual is taken and the array is freed later on - duplicate boiler plate everywhere the array is browsed through Allocate an array of pointers and populate it instead. Signed-off-by: Greg Kurz <groug@kaod.org> Signed-off-by: Cédric Le Goater <clg@kaod.org> Message-Id: <20191125065820.927-4-clg@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
f87dae18d8
commit
4fa28f2390
2 changed files with 13 additions and 19 deletions
|
@ -56,7 +56,7 @@ typedef struct PnvChip {
|
|||
|
||||
uint32_t nr_cores;
|
||||
uint64_t cores_mask;
|
||||
void *cores;
|
||||
PnvCore **cores;
|
||||
|
||||
MemoryRegion xscom_mmio;
|
||||
MemoryRegion xscom;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue