
On Sun, Jan 15, 2023 at 03:03:29PM +0100, Volker Rümelin wrote:
Am 13.01.23 um 17:21 schrieb Daniel P. Berrangé:
The audio_calloc function does various checks on the size and nmembers parameters to detect various error conditions. There are only 5 callers
* alsa_poll_helper: the pollfd count is small and bounded, * audio_pcm_create_voice_pair_: allocating a single fixed size struct * audio_pcm_sw_alloc_resources_: samples could be negative zero, or overflow, so needs a check * audio_pcm_hw_add_new_: voice size could be zero for backends that don't support audio input * st_rate_start: allocating a single fixed size struct
IOW, only two of the callers need special error checks and it is clearer if their respective checks are inlined. Thus audio_calloc can be eliminated.
Hi Daniel,
my patch series at https://lists.nongnu.org/archive/html/qemu-devel/2022-12/msg02895.html also removes audio_calloc(). There will be merge conflicts.
Ah, yes, sorry I missed that. I've sent a few comments on your impl. Consider this patch dropped. 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 :|