From f5c4c049bf8b6b246445a7e27361a16195c0b4ab Mon Sep 17 00:00:00 2001 From: Christian C Date: Wed, 2 Apr 2025 18:19:43 -0700 Subject: Remove temporary allocator --- src/prog.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/prog.c b/src/prog.c index 6999a32..a676034 100644 --- a/src/prog.c +++ b/src/prog.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -98,7 +97,7 @@ int main(int arg_count, char **arg_value) { char *fname = file_list[index]; if (is_tif_ext(fname) == FALSE) { fprintf(stderr, "Allocation error?\n"); - g_free(file_list[index]); + free(file_list[index]); continue; } // If we have a tiff file @@ -109,7 +108,7 @@ int main(int arg_count, char **arg_value) { char *fpath = full_path(process_directory, fname); if (fpath == NULL) { fprintf(stderr, "Allocation error?\n"); - g_free(file_list[index]); + free(file_list[index]); continue; } if (!suppress_outputs_b) { @@ -121,8 +120,8 @@ int main(int arg_count, char **arg_value) { Mask *file_im = tif_to_labels(fpath, &starting_label); if (file_im == NULL) { fprintf(stderr, "Allocation error?\n"); - g_free(fpath); - g_free(file_list[index]); + free(fpath); + free(file_list[index]); continue; } //----------------------------------------------- @@ -130,10 +129,10 @@ int main(int arg_count, char **arg_value) { //----------------------------------------------- masks_im = combine_masks(masks_im, file_im); free_image_mask(file_im); - g_free(fpath); - g_free(file_list[index]); + free(fpath); + free(file_list[index]); } - g_free(file_list); + free(file_list); } } } @@ -209,8 +208,8 @@ int main(int arg_count, char **arg_value) { Bitmap *bitmap = image_mask_data_to_bitmap(masks_im); if (bitmap != NULL) { save_png(bitmap, png_output_file_fullpath); - g_free(bitmap->image_buffer); - g_free(bitmap); + free(bitmap->image_buffer); + free(bitmap); } write_array(bin_output_file_fullpath, masks_im->image[0], width * height * sizeof(MaskData_t)); @@ -220,6 +219,5 @@ int main(int arg_count, char **arg_value) { if (!suppress_outputs_b) { printf("Finished in %f ms\n", 1000 * diff_time(&ts_g_end, &ts_g_start)); } - printf("Outstanding allocations: %zu\n", g_outstanding_allocations()); return 0; } -- cgit v1.2.1