From e7dc56669417792563269ee336e4ff37ae77ff03 Mon Sep 17 00:00:00 2001 From: Omar Mohamed Date: Thu, 25 Dec 2025 01:08:12 +0200 Subject: [PATCH] bench: refactor to use dynamic memory allocation in strided/base/smap --- .../strided/base/smap/benchmark/c/benchmark.length.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/strided/base/smap/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/strided/base/smap/benchmark/c/benchmark.length.c index 68f223a21452..088b5d3aaf0d 100644 --- a/lib/node_modules/@stdlib/strided/base/smap/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/strided/base/smap/benchmark/c/benchmark.length.c @@ -106,11 +106,13 @@ static float identity( const float x ) { */ static double benchmark( int iterations, int len ) { double elapsed; - float x[ len ]; - float y[ len ]; + float *x; + float *y; double t; int i; + x = (float *)malloc( len * sizeof( float ) ); + y = (float *)malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_float()*200.0f ) - 100.0f; y[ i ] = 0.0f; @@ -128,6 +130,8 @@ static double benchmark( int iterations, int len ) { if ( y[ i%len ] != y[ i%len ] ) { printf( "should not return NaN\n" ); } + free( x ); + free( y ); return elapsed; }