Re: [PATCH 2/5] rust: hpet: fully initialize object after instance_init

2025-06-11 Thread Zhao Liu
On Mon, Jun 09, 2025 at 05:44:20PM +0200, Paolo Bonzini wrote: > Date: Mon, 9 Jun 2025 17:44:20 +0200 > From: Paolo Bonzini > Subject: [PATCH 2/5] rust: hpet: fully initialize object after instance_init > X-Mailer: git-send-email 2.49.0 > > The array of BqlRefCell is not init

[PATCH 2/5] rust: hpet: fully initialize object after instance_init

2025-06-09 Thread Paolo Bonzini
The array of BqlRefCell is not initialized yet at the end of instance_init. In particular, the "state" field is NonNull and therefore it is invalid to have it as zero bytes. Note that MaybeUninit is necessary because assigning to self.timers[index] would trigger Drop of the old value. Signed-off