[PATCH v2 09/19] latencystats: remove use of VLAs for Windows built code
Tyler Retzlaff
roretzla at linux.microsoft.com
Thu Apr 18 22:02:32 CEST 2024
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 at linux.microsoft.com>
---
lib/latencystats/rte_latencystats.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/latencystats/rte_latencystats.c b/lib/latencystats/rte_latencystats.c
index 4ea9b0d..f59a9eb 100644
--- a/lib/latencystats/rte_latencystats.c
+++ b/lib/latencystats/rte_latencystats.c
@@ -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,
--
1.8.3.1
More information about the dev
mailing list