Skip to content

Commit a64dcc4

Browse files
authored
Discard changes to lib/node_modules/@stdlib/math/strided/special/sabs2/benchmark/c/benchmark.length.c
1 parent 69839bb commit a64dcc4

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

lib/node_modules/@stdlib/math/strided/special/sabs2/benchmark/c/benchmark.length.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,11 @@ static float rand_float( void ) {
9696
*/
9797
static double benchmark( int iterations, int len ) {
9898
double elapsed;
99-
float *x = (float *) malloc(len * sizeof(float));
100-
float *y = (float *) malloc(len * sizeof(float));
99+
float x[ len ];
100+
float y[ len ];
101101
double t;
102102
int i;
103103

104-
if (x == NULL || y == NULL) {
105-
printf("Memory allocation failed.\n");
106-
exit(1);
107-
}
108-
109104
for ( i = 0; i < len; i++ ) {
110105
x[ i ] = ( rand_float()*200.0f ) - 100.0f;
111106
y[ i ] = 0.0f;
@@ -122,11 +117,6 @@ static double benchmark( int iterations, int len ) {
122117
if ( y[ 0 ] != y[ 0 ] ) {
123118
printf( "should not return NaN\n" );
124119
}
125-
126-
// 🧹 Always clean up heap allocations
127-
free(x);
128-
free(y);
129-
130120
return elapsed;
131121
}
132122

0 commit comments

Comments
 (0)