Re: [PATCH 03/23] chardev/baum: Use definitions to avoid dynamic stack allocation

2021-05-05 Thread Samuel Thibault
Marc-André Lureau, le jeu. 06 mai 2021 01:27:25 +0400, a ecrit: > @@ -408,7 +408,7 @@ static int baum_eat_packet(BaumChardev *baum, const > uint8_t *buf, int len) >          } >          timer_del(baum->cellCount_timer); > > -        memset(zero, 0, sizeof(zero)); > +     

Re: [PATCH 03/23] chardev/baum: Use definitions to avoid dynamic stack allocation

2021-05-05 Thread Marc-André Lureau
On Thu, May 6, 2021 at 1:14 AM Philippe Mathieu-Daudé wrote: > We know 'x * y' will be at most 'X_MAX * Y_MAX' (which is not > a big value, it is actually 84). Instead of having the compiler > use variable-length array, declare an array able to hold the > maximum 'x * y'. > > Signed-off-by:

Re: [PATCH 03/23] chardev/baum: Use definitions to avoid dynamic stack allocation

2021-05-05 Thread Samuel Thibault
Philippe Mathieu-Daudé, le mer. 05 mai 2021 23:10:27 +0200, a ecrit: > We know 'x * y' will be at most 'X_MAX * Y_MAX' (which is not > a big value, it is actually 84). Instead of having the compiler > use variable-length array, declare an array able to hold the > maximum 'x * y'. > >

[PATCH 03/23] chardev/baum: Use definitions to avoid dynamic stack allocation

2021-05-05 Thread Philippe Mathieu-Daudé
We know 'x * y' will be at most 'X_MAX * Y_MAX' (which is not a big value, it is actually 84). Instead of having the compiler use variable-length array, declare an array able to hold the maximum 'x * y'. Signed-off-by: Philippe Mathieu-Daudé --- chardev/baum.c | 8 1 file changed, 4