[vlc-devel] [PATCH 09/12] network: io: Remove VLA usages

Thomas Guillem thomas at gllm.fr
Fri Dec 11 17:23:13 CET 2020

On Fri, Dec 11, 2020, at 16:46, Pierre Ynard via vlc-devel wrote:
> > I agree with Steve. I want to minimize #ifdef usage and double
> > implementation.
> Maybe we all agree on that part then, because I want to minimize #ifdef
> usage too.
> > For me, the main advantage of VLA is code simplicity. If you have to put
> > ifdef and implement something twice, you kill the simplicity.
> I like simplicity too. But as pointed out by Rémi, and as I meant
> when talking about uses that are "actually beneficial to the code",
> there are other advantages to VLAs than simplicity, some of which more
> objective like performance. What do you think about those, and do you
> think simplicity should trump them?

More performant, when you compare to malloc, right? I don't think VLC has critical code using VLA that need to be performant. If it happens, you can always rethink your algorithm, pre-allocate data, try to calculate the maximum size...

> -- 
> Pierre Ynard
> "Une âme dans un corps, c'est comme un dessin sur une feuille de papier."
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

More information about the vlc-devel mailing list