From 1f3a7dc59cb03a74762f5d4b5c988553147db90f Mon Sep 17 00:00:00 2001 From: Samarth Kolarkar Date: Wed, 17 Dec 2025 19:12:19 +0530 Subject: [PATCH] bench/blas-ext-base-sapx --- .../blas/ext/base/sapx/benchmark/c/benchmark.length.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/sapx/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/sapx/benchmark/c/benchmark.length.c index ae841c296048..3d06dc73d236 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/sapx/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/sapx/benchmark/c/benchmark.length.c @@ -96,10 +96,11 @@ static float rand_float( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - float x[ len ]; + float *x; double t; int i; + x = (float *)malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_float()*200.0f ) - 100.0f; } @@ -116,6 +117,7 @@ static double benchmark1( int iterations, int len ) { if ( x[ 0 ] != x[ 0 ] ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -128,10 +130,11 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - float x[ len ]; + float *x; double t; int i; + x = (float *)malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_float()*200.0f ) - 100.0f; } @@ -148,6 +151,7 @@ static double benchmark2( int iterations, int len ) { if ( x[ 0 ] != x[ 0 ] ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; }