ext/h3/src/src/apps/benchmarks/benchmarkPolyfill.c in h3-3.4.0 vs ext/h3/src/src/apps/benchmarks/benchmarkPolyfill.c in h3-3.4.4

- old
+ new

@@ -14,11 +14,10 @@ * limitations under the License. */ #include "algos.h" #include "benchmark.h" #include "h3api.h" -#include "stackAlloc.h" // Fixtures GeoCoord sfVerts[] = { {0.659966917655, -2.1364398519396}, {0.6595011102219, -2.1359434279405}, {0.6583348114025, -2.1354884206045}, {0.6581220034068, -2.1382437718946}, @@ -118,25 +117,29 @@ southernGeofence.numVerts = 23; southernGeofence.verts = southernVerts; southernGeoPolygon.geofence = southernGeofence; int numHexagons; +H3Index* hexagons; BENCHMARK(polyfillSF, 500, { numHexagons = H3_EXPORT(maxPolyfillSize)(&sfGeoPolygon, 9); - STACK_ARRAY_CALLOC(H3Index, hexagons, numHexagons); + hexagons = calloc(numHexagons, sizeof(H3Index)); H3_EXPORT(polyfill)(&sfGeoPolygon, 9, hexagons); + free(hexagons); }); BENCHMARK(polyfillAlameda, 500, { numHexagons = H3_EXPORT(maxPolyfillSize)(&alamedaGeoPolygon, 9); - STACK_ARRAY_CALLOC(H3Index, hexagons, numHexagons); + hexagons = calloc(numHexagons, sizeof(H3Index)); H3_EXPORT(polyfill)(&alamedaGeoPolygon, 9, hexagons); + free(hexagons); }); BENCHMARK(polyfillSouthernExpansion, 10, { numHexagons = H3_EXPORT(maxPolyfillSize)(&southernGeoPolygon, 9); - STACK_ARRAY_CALLOC(H3Index, hexagons, numHexagons); + hexagons = calloc(numHexagons, sizeof(H3Index)); H3_EXPORT(polyfill)(&southernGeoPolygon, 9, hexagons); + free(hexagons); }); END_BENCHMARKS();