File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
lib/node_modules/@stdlib/math/strided/special/smskdeg2rad/benchmark/c Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -115,12 +115,15 @@ float rand_uniformf( float a, float b ) {
115115*/
116116static double benchmark ( int iterations , int len ) {
117117 double elapsed ;
118- uint8_t m [ len ] ;
119- float x [ len ] ;
120- float y [ len ] ;
118+ uint8_t * m ;
119+ float * x ;
120+ float * y ;
121121 double t ;
122122 int i ;
123123
124+ m = (uint8_t * ) malloc ( len * sizeof ( uint8_t ) );
125+ x = (float * ) malloc ( len * sizeof ( float ) );
126+ y = (float * ) malloc ( len * sizeof ( float ) );
124127 for ( i = 0 ; i < len ; i ++ ) {
125128 x [ i ] = rand_uniformf ( -180.0f , 180.0f );
126129 y [ i ] = 0.0f ;
@@ -138,6 +141,9 @@ static double benchmark( int iterations, int len ) {
138141 if ( y [ 0 ] != y [ 0 ] ) {
139142 printf ( "should not return NaN\n" );
140143 }
144+ free ( m );
145+ free ( x );
146+ free ( y );
141147 return elapsed ;
142148}
143149
You can’t perform that action at this time.
0 commit comments