From 96c06333753c1186b20bd93a6e4ca001617cbd2c Mon Sep 17 00:00:00 2001 From: thzthix Date: Tue, 23 Dec 2025 14:02:49 +0900 Subject: [PATCH] refactor: convert static to dynamic allocation in benchmark Signed-off-by: thzthix --- .../special/dmskrsqrt/benchmark/c/benchmark.length.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/math/strided/special/dmskrsqrt/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/math/strided/special/dmskrsqrt/benchmark/c/benchmark.length.c index 3237e4ed8a9d..e0e4a8a1e362 100644 --- a/lib/node_modules/@stdlib/math/strided/special/dmskrsqrt/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/math/strided/special/dmskrsqrt/benchmark/c/benchmark.length.c @@ -115,12 +115,15 @@ float rand_uniformf( float a, float b ) { */ static double benchmark( int iterations, int len ) { double elapsed; - uint8_t m[ len ]; - double x[ len ]; - double y[ len ]; + uint8_t *m; + double *x; + double *y; double t; int i; + m = (uint8_t *)malloc( len *sizeof( uint8_t ) ); + x = (double *)malloc( len * sizeof( double ) ); + y = (double *)malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = rand_uniform( 0.0, 200.0 ); y[ i ] = 0.0; @@ -138,6 +141,9 @@ static double benchmark( int iterations, int len ) { if ( y[ 0 ] != y[ 0 ] ) { printf( "should not return NaN\n" ); } + free( m ); + free( x ); + free( y ); return elapsed; }