From 91975cd9ff107ec495e30c09250b97f0a0d0bec3 Mon Sep 17 00:00:00 2001 From: Omar Mohamed Date: Thu, 25 Dec 2025 00:25:48 +0200 Subject: [PATCH 1/2] bench: refactor to use dynamic memory allocation in strided/base/smskmap --- .../base/smskmap/benchmark/c/benchmark.length.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/strided/base/smskmap/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/strided/base/smskmap/benchmark/c/benchmark.length.c index a005a0f13ef8..9c400c69771d 100644 --- a/lib/node_modules/@stdlib/strided/base/smskmap/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/strided/base/smskmap/benchmark/c/benchmark.length.c @@ -106,13 +106,16 @@ static float identity( const float x ) { * @return elapsed time in seconds */ static double benchmark( int iterations, int len ) { - uint8_t m[ len ]; + uint8_t *m; double elapsed; - float x[ len ]; - float y[ len ]; + float *x; + float *y; double t; int i; + m = (uint8_t *)malloc( len * sizeof( uint8_t ) ); + 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; m[ i ] = i % 2; @@ -131,6 +134,9 @@ static double benchmark( int iterations, int len ) { if ( y[ i%len ] != y[ i%len ] ) { printf( "should not return NaN\n" ); } + free( m ); + free( x ); + free( y ); return elapsed; } From e865920b66cf6954f43111b84e7d003f509c9927 Mon Sep 17 00:00:00 2001 From: Athan Date: Wed, 24 Dec 2025 14:42:50 -0800 Subject: [PATCH 2/2] style: reorder variable declarations Signed-off-by: Athan --- .../@stdlib/strided/base/smskmap/benchmark/c/benchmark.length.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/strided/base/smskmap/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/strided/base/smskmap/benchmark/c/benchmark.length.c index 9c400c69771d..1d5010a5dbe7 100644 --- a/lib/node_modules/@stdlib/strided/base/smskmap/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/strided/base/smskmap/benchmark/c/benchmark.length.c @@ -106,8 +106,8 @@ static float identity( const float x ) { * @return elapsed time in seconds */ static double benchmark( int iterations, int len ) { - uint8_t *m; double elapsed; + uint8_t *m; float *x; float *y; double t;