[v3,09/19] latencystats: remove use of VLAs for Windows built code
Checks
Commit Message
MSVC does not support VLAs, replace VLAs with standard C arrays
or alloca(). alloca() is available for all toolchain/platform
combinations officially supported by DPDK.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
lib/latencystats/rte_latencystats.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon, 6 May 2024 11:18:41 -0700
Tyler Retzlaff <roretzla@linux.microsoft.com> wrote:
> MSVC does not support VLAs, replace VLAs with standard C arrays
> or alloca(). alloca() is available for all toolchain/platform
> combinations officially supported by DPDK.
>
> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
See the alternate patch, the temporary array is unneeded.
@@ -159,7 +159,7 @@ struct latency_stats_nameoff {
{
unsigned int i, cnt = 0;
uint64_t now;
- float latency[nb_pkts];
+ float *latency = alloca(sizeof(float) * nb_pkts);
static float prev_latency;
/*
* Alpha represents degree of weighting decrease in EWMA,