[07/16] rcu: 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/rcu/rte_rcu_qsbr.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
@@ -356,7 +356,7 @@ int rte_rcu_qsbr_dq_enqueue(struct rte_rcu_qsbr_dq *dq, void *e)
return 1;
}
- char data[dq->esize];
+ char *data = alloca(dq->esize);
dq_elem = (__rte_rcu_qsbr_dq_elem_t *)data;
/* Start the grace period */
dq_elem->token = rte_rcu_qsbr_start(dq->v);
@@ -419,10 +419,10 @@ int rte_rcu_qsbr_dq_enqueue(struct rte_rcu_qsbr_dq *dq, void *e)
cnt = 0;
- char data[dq->esize];
+ char *data = alloca(dq->esize);
/* Check reader threads quiescent state and reclaim resources */
while (cnt < n &&
- rte_ring_dequeue_bulk_elem_start(dq->r, &data,
+ rte_ring_dequeue_bulk_elem_start(dq->r, data,
dq->esize, 1, available) != 0) {
dq_elem = (__rte_rcu_qsbr_dq_elem_t *)data;