From 899765845196007c695a2f858dbe3a41b8db4a2b Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Sun, 7 Mar 2021 19:14:19 -0500 Subject: SD-VBS: Fix memory leaks and tweak allocation bounds - Fix leaks in localization, multi_ncut, svm, and texture_synthesis - Lower preallocation for sift and texture_synthesis to match memory profile with QCIF - Remove trailing whitespace in script_localization.c --- SD-VBS/benchmarks/texture_synthesis/src/c/script_texture_synthesis.c | 4 +++- SD-VBS/benchmarks/texture_synthesis/src/c/texture.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'SD-VBS/benchmarks/texture_synthesis/src/c') diff --git a/SD-VBS/benchmarks/texture_synthesis/src/c/script_texture_synthesis.c b/SD-VBS/benchmarks/texture_synthesis/src/c/script_texture_synthesis.c index 2ebb423..a3042e5 100644 --- a/SD-VBS/benchmarks/texture_synthesis/src/c/script_texture_synthesis.c +++ b/SD-VBS/benchmarks/texture_synthesis/src/c/script_texture_synthesis.c @@ -5,7 +5,7 @@ Author: Sravanthi Kota Venkata #include "texture.h" #include #include "extra.h" -#define TEXTURE_MEM 1<<28 +#define TEXTURE_MEM 1<<20 int WIDTHin,HEIGHTin; F2D *target, *result; int WIDTH,HEIGHT; @@ -48,6 +48,8 @@ int main(int argc, char **argv) fFreeHandle(target); fFreeHandle(result); free(atlas); + free(xloopout - WIDTH/2); + free(yloopout - HEIGHT/2); WRITE_TO_FILE return 0; } diff --git a/SD-VBS/benchmarks/texture_synthesis/src/c/texture.c b/SD-VBS/benchmarks/texture_synthesis/src/c/texture.c index fb0f1ae..b268df9 100644 --- a/SD-VBS/benchmarks/texture_synthesis/src/c/texture.c +++ b/SD-VBS/benchmarks/texture_synthesis/src/c/texture.c @@ -150,6 +150,8 @@ void create_texture(F2D *image, params *data) arrayref(atlas,aa(j,i)+1) = besty; } } + free(candlistx); + free(candlisty); } // Creates a list of valid candidates for given pixel using only L-shaped causal area -- cgit v1.2.2