diff --git a/lib/node_modules/@stdlib/number/uint8/base/sub/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/number/uint8/base/sub/benchmark/c/benchmark.c index 4ec1f3567114..26ca3c1a7a75 100644 --- a/lib/node_modules/@stdlib/number/uint8/base/sub/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/number/uint8/base/sub/benchmark/c/benchmark.c @@ -99,12 +99,13 @@ static uint8_t sub( const uint8_t x, const uint8_t y ) { * @return elapsed time in seconds */ static double benchmark( void ) { - uint8_t x[ 100 ]; + uint8_t *x; double elapsed; uint8_t y; double t; int i; + x = (uint8_t *) malloc( 100 * sizeof( uint8_t ) ); for ( i = 0; i < 100; i++ ) { x[ i ] = (uint8_t)( 50.0*rand_double() ) + 10; } @@ -121,6 +122,7 @@ static double benchmark( void ) { if ( y > 100 ) { printf( "unexpected result\n" ); } + free( x ); return elapsed; } diff --git a/lib/node_modules/@stdlib/number/uint8/base/sub/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/number/uint8/base/sub/benchmark/c/native/benchmark.c index f2f22b824cb6..1d45676b8664 100644 --- a/lib/node_modules/@stdlib/number/uint8/base/sub/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/number/uint8/base/sub/benchmark/c/native/benchmark.c @@ -91,12 +91,13 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark( void ) { - uint8_t x[ 100 ]; + uint8_t *x; double elapsed; uint8_t y; double t; int i; + x = (uint8_t *) malloc( 100 * sizeof( uint8_t ) ); for ( i = 0; i < 100; i++ ) { x[ i ] = (uint8_t)( 50.0*rand_double() ) + 10; } @@ -113,6 +114,7 @@ static double benchmark( void ) { if ( y > 100 ) { printf( "unexpected value\n" ); } + free( x ); return elapsed; }