[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 03/23] chardev/baum: Use definitions to avoid dynamic stack a
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 03/23] chardev/baum: Use definitions to avoid dynamic stack allocation |
Date: |
Wed, 5 May 2021 23:39:52 +0200 |
User-agent: |
NeoMutt/20170609 (1.8.3) |
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));
> + memset(zero, 0, baum->x * baum->y);
>
>
> eh, I would have left the sizeof(zero)..
I was wondering too, but below this it's clear that only
baum->x * baum->y is getting used.
Samuel
- [PATCH 00/23] misc: Remove variable-length arrays on the stack, Philippe Mathieu-Daudé, 2021/05/05
- [PATCH 01/23] block/vpc: Avoid dynamic stack allocation, Philippe Mathieu-Daudé, 2021/05/05
- [PATCH 02/23] chardev/baum: Replace magic values by X_MAX / Y_MAX definitions, Philippe Mathieu-Daudé, 2021/05/05
- [PATCH 03/23] chardev/baum: Use definitions to avoid dynamic stack allocation, Philippe Mathieu-Daudé, 2021/05/05
- [PATCH 04/23] chardev/baum: Avoid dynamic stack allocation, Philippe Mathieu-Daudé, 2021/05/05
- [PATCH 05/23] io/channel-websock: Replace strlen(const_str) by sizeof(const_str) - 1, Philippe Mathieu-Daudé, 2021/05/05
- [PATCH 06/23] hw/block/dataplane/virtio-blk: Avoid dynamic stack allocation, Philippe Mathieu-Daudé, 2021/05/05