diff --git a/lib/node_modules/@stdlib/blas/base/dgemv/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/dgemv/benchmark/c/benchmark.length.c index 912eaae082b8..1a3d8f32222b 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemv/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/dgemv/benchmark/c/benchmark.length.c @@ -96,13 +96,16 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int N ) { double elapsed; - double A[ N*N ]; - double x[ N ]; - double y[ N ]; + double *A; + double *x; + double *y; double t; int i; int j; + A = (double *) malloc( N * N * sizeof( double ) ); + x = (double *) malloc( N * sizeof( double ) ); + y = (double *) malloc( N * sizeof( double ) ); for ( i = 0; i < N; i++ ) { x[ i ] = ( rand_double()*20.0 ) - 10.0; y[ i ] = ( rand_double()*20.0 ) - 10.0; @@ -123,6 +126,9 @@ static double benchmark1( int iterations, int N ) { if ( y[ i%N ] != y[ i%N ] ) { printf( "should not return NaN\n" ); } + free( A ); + free( x ); + free( y ); return elapsed; } @@ -135,13 +141,16 @@ static double benchmark1( int iterations, int N ) { */ static double benchmark2( int iterations, int N ) { double elapsed; - double A[ N*N ]; - double x[ N ]; - double y[ N ]; + double *A; + double *x; + double *y; double t; int i; int j; + A = (double *) malloc( N * N * sizeof( double ) ); + x = (double *) malloc( N * sizeof( double ) ); + y = (double *) malloc( N * sizeof( double ) ); for ( i = 0; i < N; i++ ) { x[ i ] = ( rand_double()*20.0 ) - 10.0; y[ i ] = ( rand_double()*20.0 ) - 10.0; @@ -162,6 +171,9 @@ static double benchmark2( int iterations, int N ) { if ( y[ i%N ] != y[ i%N ] ){ printf( "should not return NaN\n" ); } + free( A ); + free( x ); + free( y ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/base/dger/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/dger/benchmark/c/benchmark.length.c index 754dc8568cab..26c91c8c7444 100644 --- a/lib/node_modules/@stdlib/blas/base/dger/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/dger/benchmark/c/benchmark.length.c @@ -97,13 +97,16 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int N ) { double elapsed; - double A[ N*N ]; - double x[ N ]; - double y[ N ]; + double *A; + double *x; + double *y; double t; int i; int j; + A = (double *) malloc( N * N * sizeof( double ) ); + x = (double *) malloc( N * sizeof( double ) ); + y = (double *) malloc( N * sizeof( double ) ); for ( i = 0; i < N; i++ ) { x[ i ] = ( rand_double()*20.0 ) - 10.0; y[ i ] = ( rand_double()*20.0 ) - 10.0; @@ -124,6 +127,9 @@ static double benchmark1( int iterations, int N ) { if ( A[ i%(N*2) ] != A[ i%(N*2) ] ) { printf( "should not return NaN\n" ); } + free( A ); + free( x ); + free( y ); return elapsed; } @@ -136,13 +142,16 @@ static double benchmark1( int iterations, int N ) { */ static double benchmark2( int iterations, int N ) { double elapsed; - double A[ N*N ]; - double x[ N ]; - double y[ N ]; + double *A; + double *x; + double *y; double t; int i; int j; + A = (double *) malloc( N * N * sizeof( double ) ); + x = (double *) malloc( N * sizeof( double ) ); + y = (double *) malloc( N * sizeof( double ) ); for ( i = 0; i < N; i++ ) { x[ i ] = ( rand_double()*20.0 ) - 10.0; y[ i ] = ( rand_double()*20.0 ) - 10.0; @@ -163,6 +172,9 @@ static double benchmark2( int iterations, int N ) { if ( A[ i%(N*2) ] != A[ i%(N*2) ] ) { printf( "should not return NaN\n" ); } + free( A ); + free( x ); + free( y ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/c/benchmark.length.c index a9a222d8332e..d31bd6ae4e2e 100644 --- a/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/dznrm2/benchmark/c/benchmark.length.c @@ -95,12 +95,13 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark1( int iterations, int len ) { - double X[ len*2 ]; double elapsed; double norm; + double *X; double t; int i; + X = (double *) malloc( len * 2 * sizeof( double ) ); for ( i = 0; i < len*2; i += 2 ) { X[ i ] = ( rand_double()*10000.0 ) - 5000.0; X[ i+1 ] = ( rand_double()*10000.0 ) - 5000.0; @@ -118,6 +119,7 @@ static double benchmark1( int iterations, int len ) { if ( norm != norm ) { printf( "should not return NaN\n" ); } + free( X ); return elapsed; } @@ -129,12 +131,13 @@ static double benchmark1( int iterations, int len ) { * @return elapsed time in seconds */ static double benchmark2( int iterations, int len ) { - double X[ len*2 ]; double elapsed; double norm; + double *X; double t; int i; + X = (double *) malloc( len * 2 * sizeof( double ) ); for ( i = 0; i < len*2; i += 2 ) { X[ i ] = ( rand_double()*10000.0 ) - 5000.0; X[ i+1 ] = ( rand_double()*10000.0 ) - 5000.0; @@ -152,6 +155,7 @@ static double benchmark2( int iterations, int len ) { if ( norm != norm ) { printf( "should not return NaN\n" ); } + free( X ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/base/scasum/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/scasum/benchmark/c/benchmark.length.c index 007a5b94b37f..53da76d61bf8 100644 --- a/lib/node_modules/@stdlib/blas/base/scasum/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/scasum/benchmark/c/benchmark.length.c @@ -95,12 +95,13 @@ static float rand_float( void ) { * @return elapsed time in seconds */ static double benchmark1( int iterations, int len ) { - float X[ len*2 ]; double elapsed; float out; double t; + float *X; int i; + X = (float *) malloc( len * 2 * sizeof( float ) ); for ( i = 0; i < len*2; i += 2 ) { X[ i ] = ( rand_float()*10000.0f ) - 5000.0f; X[ i+1 ] = ( rand_float()*10000.0f ) - 5000.0f; @@ -118,6 +119,7 @@ static double benchmark1( int iterations, int len ) { if ( out != out ) { printf( "should not return NaN\n" ); } + free( X ); return elapsed; } @@ -129,12 +131,13 @@ static double benchmark1( int iterations, int len ) { * @return elapsed time in seconds */ static double benchmark2( int iterations, int len ) { - float X[ len*2 ]; double elapsed; float out; double t; + float *X; int i; + X = (float *) malloc( len * 2 * sizeof( float ) ); for ( i = 0; i < len*2; i += 2 ) { X[ i ] = ( rand_float()*10000.0f ) - 5000.0f; X[ i+1 ] = ( rand_float()*10000.0f ) - 5000.0f; @@ -152,6 +155,7 @@ static double benchmark2( int iterations, int len ) { if ( out != out ) { printf( "should not return NaN\n" ); } + free( X ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/c/benchmark.length.c index 342f0bff372a..9b498be25007 100644 --- a/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/scnrm2/benchmark/c/benchmark.length.c @@ -95,12 +95,13 @@ static float rand_float( void ) { * @return elapsed time in seconds */ static double benchmark1( int iterations, int len ) { - float X[ len*2 ]; double elapsed; float norm; double t; + float *X; int i; + X = (float *) malloc( len * 2 * sizeof( float ) ); for ( i = 0; i < len*2; i += 2 ) { X[ i ] = ( rand_float()*10000.0f ) - 5000.0f; X[ i+1 ] = ( rand_float()*10000.0f ) - 5000.0f; @@ -118,6 +119,7 @@ static double benchmark1( int iterations, int len ) { if ( norm != norm ) { printf( "should not return NaN\n" ); } + free( X ); return elapsed; } @@ -129,12 +131,13 @@ static double benchmark1( int iterations, int len ) { * @return elapsed time in seconds */ static double benchmark2( int iterations, int len ) { - float X[ len*2 ]; double elapsed; float norm; double t; + float *X; int i; + X = (float *) malloc( len * 2 * sizeof( float ) ); for ( i = 0; i < len*2; i += 2 ) { X[ i ] = ( rand_float()*10000.0f ) - 5000.0f; X[ i+1 ] = ( rand_float()*10000.0f ) - 5000.0f; @@ -152,6 +155,7 @@ static double benchmark2( int iterations, int len ) { if ( norm != norm ) { printf( "should not return NaN\n" ); } + free( X ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/base/sgemv/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/sgemv/benchmark/c/benchmark.length.c index 4f90a56409e5..e66c5ade65f4 100644 --- a/lib/node_modules/@stdlib/blas/base/sgemv/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/sgemv/benchmark/c/benchmark.length.c @@ -96,13 +96,16 @@ static float rand_float( void ) { */ static double benchmark1( int iterations, int N ) { double elapsed; - float A[ N*N ]; - float x[ N ]; - float y[ N ]; + float *A; + float *x; + float *y; double t; int i; int j; + A = (float *) malloc( N * N * sizeof( float ) ); + x = (float *) malloc( N * sizeof( float ) ); + y = (float *) malloc( N * sizeof( float ) ); for ( i = 0; i < N; i++ ) { x[ i ] = ( rand_float()*20.0f ) - 10.0f; y[ i ] = ( rand_float()*20.0f ) - 10.0f; @@ -123,6 +126,9 @@ static double benchmark1( int iterations, int N ) { if ( y[ i%N ] != y[ i%N ] ) { printf( "should not return NaN\n" ); } + free( A ); + free( x ); + free( y ); return elapsed; } @@ -135,13 +141,16 @@ static double benchmark1( int iterations, int N ) { */ static double benchmark2( int iterations, int N ) { double elapsed; - float A[ N*N ]; - float x[ N ]; - float y[ N ]; + float *A; + float *x; + float *y; double t; int i; int j; + A = (float *) malloc( N * N * sizeof( float ) ); + x = (float *) malloc( N * sizeof( float ) ); + y = (float *) malloc( N * sizeof( float ) ); for ( i = 0; i < N; i++ ) { x[ i ] = ( rand_float()*20.0f ) - 10.0f; y[ i ] = ( rand_float()*20.0f ) - 10.0f; @@ -162,6 +171,9 @@ static double benchmark2( int iterations, int N ) { if ( y[ i%N ] != y[ i%N ] ){ printf( "should not return NaN\n" ); } + free( A ); + free( x ); + free( y ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/base/sger/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/sger/benchmark/c/benchmark.length.c index c0539ad9f739..8ea7f81885ba 100644 --- a/lib/node_modules/@stdlib/blas/base/sger/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/sger/benchmark/c/benchmark.length.c @@ -97,13 +97,16 @@ static float rand_float( void ) { */ static double benchmark1( int iterations, int N ) { double elapsed; - float A[ N*N ]; - float x[ N ]; - float y[ N ]; + float *A; + float *x; + float *y; double t; int i; int j; + A = (float *) malloc( N * N * sizeof( float ) ); + x = (float *) malloc( N * sizeof( float ) ); + y = (float *) malloc( N * sizeof( float ) ); for ( i = 0; i < N; i++ ) { x[ i ] = ( rand_float()*20.0f ) - 10.0f; y[ i ] = ( rand_float()*20.0f ) - 10.0f; @@ -124,6 +127,9 @@ static double benchmark1( int iterations, int N ) { if ( A[ i%(N*2) ] != A[ i%(N*2) ] ) { printf( "should not return NaN\n" ); } + free( A ); + free( x ); + free( y ); return elapsed; } @@ -136,13 +142,16 @@ static double benchmark1( int iterations, int N ) { */ static double benchmark2( int iterations, int N ) { double elapsed; - float A[ N*N ]; - float x[ N ]; - float y[ N ]; + float *A; + float *x; + float *y; double t; int i; int j; + A = (float *) malloc( N * N * sizeof( float ) ); + x = (float *) malloc( N * sizeof( float ) ); + y = (float *) malloc( N * sizeof( float ) ); for ( i = 0; i < N; i++ ) { x[ i ] = ( rand_float()*20.0f ) - 10.0f; y[ i ] = ( rand_float()*20.0f ) - 10.0f; @@ -163,6 +172,9 @@ static double benchmark2( int iterations, int N ) { if ( A[ i%(N*2) ] != A[ i%(N*2) ] ) { printf( "should not return NaN\n" ); } + free( A ); + free( x ); + free( y ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/base/zdrot/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/zdrot/benchmark/c/benchmark.length.c index c3e30660da2d..a8ddc58ac98f 100644 --- a/lib/node_modules/@stdlib/blas/base/zdrot/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/zdrot/benchmark/c/benchmark.length.c @@ -96,11 +96,13 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - double x[ len*2 ]; - double y[ len*2 ]; + double *x; + double *y; double t; int i; + x = (double *) malloc( len * 2 * sizeof( double ) ); + y = (double *) malloc( len * 2 * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double()*10000.0 ) - 5000.0; x[ i+1 ] = ( rand_double()*10000.0 ) - 5000.0; @@ -119,6 +121,8 @@ static double benchmark1( int iterations, int len ) { if ( y[ 0 ] != y[ 0 ] ) { printf( "should not return NaN\n" ); } + free( x ); + free( y ); return elapsed; } @@ -131,11 +135,13 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - double x[ len*2 ]; - double y[ len*2 ]; + double *x; + double *y; double t; int i; + x = (double *) malloc( len * 2 * sizeof( double ) ); + y = (double *) malloc( len * 2 * sizeof( double ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_double()*10000.0 ) - 5000.0; x[ i+1 ] = ( rand_double()*10000.0 ) - 5000.0; @@ -154,6 +160,8 @@ static double benchmark2( int iterations, int len ) { if ( y[ 0 ] != y[ 0 ] ) { printf( "should not return NaN\n" ); } + free( x ); + free( y ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/base/zdscal/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/zdscal/benchmark/c/benchmark.length.c index e4124b662fb7..780ffd4c1ea7 100644 --- a/lib/node_modules/@stdlib/blas/base/zdscal/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/zdscal/benchmark/c/benchmark.length.c @@ -99,11 +99,12 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark1( int iterations, int len ) { - stdlib_complex128_t x[ len ]; + stdlib_complex128_t *x; double elapsed; double t; int i; + x = (stdlib_complex128_t *) malloc( len * sizeof( stdlib_complex128_t ) ); for ( i = 0; i < len; i++ ) { x[ i ] = stdlib_complex128( (rand_double()*10000.0)-5000.0, (rand_double()*10000.0)-5000.0 ); } @@ -116,9 +117,11 @@ static double benchmark1( int iterations, int len ) { } } elapsed = tic() - t; + // cppcheck-suppress uninitdata if ( stdlib_base_is_nan( stdlib_complex128_imag( x[ i%len ] ) ) ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -130,11 +133,12 @@ static double benchmark1( int iterations, int len ) { * @return elapsed time in seconds */ static double benchmark2( int iterations, int len ) { - stdlib_complex128_t x[ len ]; + stdlib_complex128_t *x; double elapsed; double t; int i; + x = (stdlib_complex128_t *) malloc( len * sizeof( stdlib_complex128_t ) ); for ( i = 0; i < len; i++ ) { x[ i ] = stdlib_complex128( (rand_double()*10000.0)-5000.0, (rand_double()*10000.0)-5000.0 ); } @@ -147,9 +151,11 @@ static double benchmark2( int iterations, int len ) { } } elapsed = tic() - t; + // cppcheck-suppress uninitdata if ( stdlib_base_is_nan( stdlib_complex128_real( x[ i%len ] ) ) ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/base/zscal/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/zscal/benchmark/c/benchmark.length.c index f325705dd28a..9ebe44baa882 100644 --- a/lib/node_modules/@stdlib/blas/base/zscal/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/zscal/benchmark/c/benchmark.length.c @@ -97,12 +97,13 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int len ) { stdlib_complex128_t alpha; - double x[ len*2 ]; double elapsed; + double *x; double t; int i; alpha = stdlib_complex128( 1.0, 0.0 ); + x = (double *) malloc( len * 2 * sizeof( double ) ); for ( i = 0; i < len*2; i+=2 ) { x[ i ] = ( rand_double()*2.0 ) - 1.0; x[ i+1 ] = ( rand_double()*2.0 ) - 1.0; @@ -119,6 +120,7 @@ static double benchmark1( int iterations, int len ) { if ( x[ 0 ] != x[ 0 ] ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -131,12 +133,13 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { stdlib_complex128_t alpha; - double x[ len*2 ]; double elapsed; + double *x; double t; int i; alpha = stdlib_complex128( 1.0, 0.0 ); + x = (double *) malloc( len * 2 * sizeof( double ) ); for ( i = 0; i < len*2; i+=2 ) { x[ i ] = ( rand_double()*2.0 ) - 1.0; x[ i+1 ] = ( rand_double()*2.0 ) - 1.0; @@ -153,6 +156,7 @@ static double benchmark2( int iterations, int len ) { if ( x[ 0 ] != x[ 0 ] ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/lapack/base/dlacpy/benchmark/c/benchmark.size.c b/lib/node_modules/@stdlib/lapack/base/dlacpy/benchmark/c/benchmark.size.c index 20b12950e661..27ba8d08686f 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlacpy/benchmark/c/benchmark.size.c +++ b/lib/node_modules/@stdlib/lapack/base/dlacpy/benchmark/c/benchmark.size.c @@ -96,12 +96,14 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int N ) { double elapsed; - double A[ N*N ]; - double B[ N*N ]; + double *A; + double *B; double t; int i; int j; + A = (double *) malloc( N * N * sizeof( double ) ); + B = (double *) malloc( N * N * sizeof( double ) ); for ( i = 0, j = 0; i < N; i++, j += 2 ) { A[ j ] = ( rand_double()*20.0 ) - 10.0; A[ j+1 ] = ( rand_double()*20.0 ) - 10.0; @@ -121,6 +123,8 @@ static double benchmark1( int iterations, int N ) { if ( B[ i%(N*2) ] != B[ i%(N*2) ] ) { printf( "should not return NaN\n" ); } + free( A ); + free( B ); return elapsed; } @@ -133,12 +137,14 @@ static double benchmark1( int iterations, int N ) { */ static double benchmark2( int iterations, int N ) { double elapsed; - double A[ N*N ]; - double B[ N*N ]; + double *A; + double *B; double t; int i; int j; + A = (double *) malloc( N * N * sizeof( double ) ); + B = (double *) malloc( N * N * sizeof( double ) ); for ( i = 0, j = 0; i < N; i++, j += 2 ) { A[ j ] = ( rand_double()*20.0 ) - 10.0; A[ j+1 ] = ( rand_double()*20.0 ) - 10.0; @@ -158,6 +164,8 @@ static double benchmark2( int iterations, int N ) { if ( B[ i%(N*2) ] != B[ i%(N*2) ] ) { printf( "should not return NaN\n" ); } + free( A ); + free( B ); return elapsed; } diff --git a/lib/node_modules/@stdlib/stats/strided/dcovmatmtk/benchmark/c/benchmark.size.c b/lib/node_modules/@stdlib/stats/strided/dcovmatmtk/benchmark/c/benchmark.size.c index c410945feb02..98bbb4d07e04 100644 --- a/lib/node_modules/@stdlib/stats/strided/dcovmatmtk/benchmark/c/benchmark.size.c +++ b/lib/node_modules/@stdlib/stats/strided/dcovmatmtk/benchmark/c/benchmark.size.c @@ -96,13 +96,16 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int N ) { double elapsed; - double A[ N*N ]; - double B[ N*N ]; - double mu[ N ]; + double *mu; + double *A; + double *B; double t; int i; int j; + A = (double *) malloc( N * N * sizeof( double ) ); + B = (double *) malloc( N * N * sizeof( double ) ); + mu = (double *) malloc( N * sizeof( double ) ); for ( i = 0; i < N; i++ ) { for ( j = 0; j < N; j++ ) { A[ (i*N)+j ] = ( rand_double()*20.0 ) - 10.0; @@ -123,6 +126,9 @@ static double benchmark1( int iterations, int N ) { if ( B[ i%(N*2) ] != B[ i%(N*2) ] ) { printf( "should not return NaN\n" ); } + free( A ); + free( B ); + free( mu ); return elapsed; } @@ -135,13 +141,16 @@ static double benchmark1( int iterations, int N ) { */ static double benchmark2( int iterations, int N ) { double elapsed; - double A[ N*N ]; - double B[ N*N ]; - double mu[ N ]; + double *mu; + double *A; + double *B; double t; int i; int j; + A = (double *) malloc( N * N * sizeof( double ) ); + B = (double *) malloc( N * N * sizeof( double ) ); + mu = (double *) malloc( N * sizeof( double ) ); for ( i = 0; i < N; i++ ) { for ( j = 0; j < N; j++ ) { A[ (i*N)+j ] = ( rand_double()*20.0 ) - 10.0; @@ -162,6 +171,9 @@ static double benchmark2( int iterations, int N ) { if ( B[ i%(N*2) ] != B[ i%(N*2) ] ) { printf( "should not return NaN\n" ); } + free( A ); + free( B ); + free( mu ); return elapsed; } diff --git a/lib/node_modules/@stdlib/stats/strided/dnanmskmax/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/stats/strided/dnanmskmax/benchmark/c/benchmark.length.c index 691f48f3ffbc..004ff31c7516 100644 --- a/lib/node_modules/@stdlib/stats/strided/dnanmskmax/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/stats/strided/dnanmskmax/benchmark/c/benchmark.length.c @@ -95,7 +95,7 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark1( int iterations, int len ) { - unsigned char mask[ len ]; + unsigned char *mask; double elapsed; double *x; double v; @@ -103,6 +103,7 @@ static double benchmark1( int iterations, int len ) { int i; x = (double *) malloc( len * sizeof( double ) ); + mask = (unsigned char *) malloc( len * sizeof( unsigned char ) ); for ( i = 0; i < len; i++ ) { if ( rand_double() < 0.2 ) { mask[ i ] = 1; // missing @@ -126,6 +127,7 @@ static double benchmark1( int iterations, int len ) { printf( "should not return NaN\n" ); } free( x ); + free( mask ); return elapsed; } @@ -137,7 +139,7 @@ static double benchmark1( int iterations, int len ) { * @return elapsed time in seconds */ static double benchmark2( int iterations, int len ) { - unsigned char mask[ len ]; + unsigned char *mask; double elapsed; double *x; double v; @@ -145,6 +147,7 @@ static double benchmark2( int iterations, int len ) { int i; x = (double *) malloc( len * sizeof( double ) ); + mask = (unsigned char *) malloc( len * sizeof( unsigned char ) ); for ( i = 0; i < len; i++ ) { if ( rand_double() < 0.2 ) { mask[ i ] = 1; // missing @@ -168,6 +171,7 @@ static double benchmark2( int iterations, int len ) { printf( "should not return NaN\n" ); } free( x ); + free( mask ); return elapsed; }