diff options
author | Joshua Bakita <jbakita@cs.unc.edu> | 2020-10-23 19:16:45 -0400 |
---|---|---|
committer | Joshua Bakita <jbakita@cs.unc.edu> | 2020-10-23 19:16:45 -0400 |
commit | e0c5691110f38f63d1955a711fc7f786333bcaad (patch) | |
tree | 39c26e944b42a38ac2bd2fb7ca3d514e2c799599 /SD-VBS/benchmarks/stitch/src | |
parent | 3498e3270194093098f9b8275901517fa2f9fa32 (diff) |
Fix heap corruption in the stitch benchmark and tweak some heap limits
Diffstat (limited to 'SD-VBS/benchmarks/stitch/src')
-rw-r--r-- | SD-VBS/benchmarks/stitch/src/c/script_stitch.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/SD-VBS/benchmarks/stitch/src/c/script_stitch.c b/SD-VBS/benchmarks/stitch/src/c/script_stitch.c index 9310048..ee68e70 100644 --- a/SD-VBS/benchmarks/stitch/src/c/script_stitch.c +++ b/SD-VBS/benchmarks/stitch/src/c/script_stitch.c | |||
@@ -5,7 +5,8 @@ Author: Sravanthi Kota Venkata | |||
5 | #include "stitch.h" | 5 | #include "stitch.h" |
6 | #include <malloc.h> | 6 | #include <malloc.h> |
7 | #include "extra.h" | 7 | #include "extra.h" |
8 | #define STITCH_MEM 1<<30 | 8 | // Valgrind says we use 250Mb of heap - round up to 512Mb |
9 | #define STITCH_MEM 1<<29 | ||
9 | int main(int argc, char* argv[]) | 10 | int main(int argc, char* argv[]) |
10 | { | 11 | { |
11 | SET_UP | 12 | SET_UP |
@@ -16,6 +17,7 @@ int main(int argc, char* argv[]) | |||
16 | I2D *Icur; | 17 | I2D *Icur; |
17 | int i, j; | 18 | int i, j; |
18 | char im1[100], im2[100]; | 19 | char im1[100], im2[100]; |
20 | x = y = v = Fcur = int1 = int2 = interestPnts = NULL; | ||
19 | 21 | ||
20 | scanf("%s", im1); | 22 | scanf("%s", im1); |
21 | Icur = readImage(im1); | 23 | Icur = readImage(im1); |
@@ -23,12 +25,11 @@ int main(int argc, char* argv[]) | |||
23 | cols = Icur->width; | 25 | cols = Icur->width; |
24 | 26 | ||
25 | for_each_job { | 27 | for_each_job { |
26 | iFreeHandle(Icur); | 28 | fFreeHandle(v); |
27 | fFreeHandle(v); | 29 | fFreeHandle(interestPnts); |
28 | fFreeHandle(interestPnts); | 30 | fFreeHandle(int1); |
29 | fFreeHandle(int1); | 31 | fFreeHandle(int2); |
30 | fFreeHandle(int2); | 32 | fFreeHandle(Fcur); |
31 | fFreeHandle(Fcur); | ||
32 | v = harris(Icur); | 33 | v = harris(Icur); |
33 | interestPnts = getANMS(v, 24); | 34 | interestPnts = getANMS(v, 24); |
34 | int1 = fMallocHandle(interestPnts->height, 1); | 35 | int1 = fMallocHandle(interestPnts->height, 1); |
@@ -56,5 +57,11 @@ int main(int argc, char* argv[]) | |||
56 | } | 57 | } |
57 | #endif | 58 | #endif |
58 | WRITE_TO_FILE | 59 | WRITE_TO_FILE |
60 | fFreeHandle(Icur); | ||
61 | fFreeHandle(v); | ||
62 | fFreeHandle(interestPnts); | ||
63 | fFreeHandle(int1); | ||
64 | fFreeHandle(int2); | ||
65 | fFreeHandle(Fcur); | ||
59 | return 0; | 66 | return 0; |
60 | } | 67 | } |