Re: [PATCH v2] bitmap: Use g_try_new0/g_renew

2024-05-02 Thread Daniel P . Berrangé
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. It

[PATCH v2] bitmap: Use g_try_new0/g_renew

2024-05-02 Thread Paolo Bonzini
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() ha