From d5201093df7b710c3b5da1756f1a769a3b849fd0 Mon Sep 17 00:00:00 2001 From: Uday Kakade Date: Mon, 20 Apr 2026 18:20:10 +0530 Subject: [PATCH] bench: refactor to use dynamic memory allocation in math/strided/special/dinv --- .../strided/special/dinv/benchmark/c/benchmark.length.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/math/strided/special/dinv/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/math/strided/special/dinv/benchmark/c/benchmark.length.c index c89da63751c9..bddf17e0bc48 100644 --- a/lib/node_modules/@stdlib/math/strided/special/dinv/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/math/strided/special/dinv/benchmark/c/benchmark.length.c @@ -114,11 +114,13 @@ float rand_uniformf( float a, float b ) { */ static double benchmark( int iterations, int len ) { double elapsed; - double x[ len ]; - double y[ len ]; + double *x; + double *y; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); + y = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = rand_uniform( -50.0, 50.0 ); y[ i ] = 0.0; @@ -136,6 +138,8 @@ static double benchmark( int iterations, int len ) { if ( y[ 0 ] != y[ 0 ] ) { printf( "should not return NaN\n" ); } + free( x ); + free( y ); return elapsed; }