Skip to content

Commit d4113ef

Browse files
bench: update benchmark to use dynamic memory allocation
Signed-off-by: Nakul Krishnakumar <nakulkrishnakumar86@gmail.com>
1 parent 62a6f05 commit d4113ef

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • lib/node_modules/@stdlib/math/base/special/fast/asinhf/benchmark/c/native

lib/node_modules/@stdlib/math/base/special/fast/asinhf/benchmark/c/native/benchmark.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,13 @@ static float random_uniform( const float min, const float max ) {
9292
* @return elapsed time in seconds
9393
*/
9494
static double benchmark( void ) {
95-
float x[ 100 ];
95+
float *x;
9696
double elapsed;
9797
double t;
9898
float y;
9999
int i;
100100

101+
x = (float *) malloc( len * sizeof( float ) );
101102
for ( i = 0; i < 100; i++ ) {
102103
x[ i ] = random_uniform( 0.0f, 100.0f );
103104
}

0 commit comments

Comments
 (0)