From f5f32b42ef2ba9dbe8fe29c7ded4902e49e7ddf5 Mon Sep 17 00:00:00 2001 From: Uday Kakade Date: Sun, 19 Apr 2026 22:07:26 +0530 Subject: [PATCH] bench: refactor to use dynamic memory allocation in stats/strided/dsem --- .../@stdlib/stats/strided/dsem/benchmark/c/benchmark.length.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/stats/strided/dsem/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/stats/strided/dsem/benchmark/c/benchmark.length.c index 6c54645bba18..968773f021db 100644 --- a/lib/node_modules/@stdlib/stats/strided/dsem/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/stats/strided/dsem/benchmark/c/benchmark.length.c @@ -96,11 +96,12 @@ static double rand_double( void ) { */ static double benchmark( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; double v; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double() * 20000.0 ) - 10000.0; } @@ -117,6 +118,7 @@ static double benchmark( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; }