On Thu, May 02, 2024 at 05:22:42PM +0200, Paolo Bonzini wrote:
> Avoids an explicit use of sizeof().  The GLib allocation macros
> ensure that the multiplication by the size of the element
> uses the right type and does not overflow.
> 
> While at it, change bitmap_new() to use g_new0 directly.  Its current
> impl of calling bitmap_try_new() followed by a plain abort() has
> worse diagnostics than g_new0, which uses g_error to report the actual
> allocation size that failed.
> 
> Cc: qemu-triv...@nongnu.org
> Cc: Roman Kiryanov <r...@google.com>
> Cc: Daniel Berrange <berra...@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>
> ---
>  include/qemu/bitmap.h | 19 ++++++++-----------
>  1 file changed, 8 insertions(+), 11 deletions(-)

Reviewed-by: Daniel P. Berrangé <berra...@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


Reply via email to