From: Enblend <enb...@li...> - 2013-01-06 09:30:31
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/afd3ebead0fe changeset: 872:afd3ebead0fe user: Chris <cs...@us...> date: Sun Jan 06 10:03:30 2013 +0100 description: Do not allocate global heap memory in the Felzenszwalb/Huttenlocher Distance Transform with Euclidean metric, but use the (thread-local) stack. This means we rely on the threads' stacks. If the stack size is too small set the environment variable OMP_STACKSIZE. diffstat: VERSION | 2 +- src/openmp.h | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diffs (30 lines): diff -r 6633c45460b0 -r afd3ebead0fe VERSION --- a/VERSION Sun Jan 06 10:02:58 2013 +0100 +++ b/VERSION Sun Jan 06 10:03:30 2013 +0100 @@ -1,1 +1,1 @@ -4.2-eeafb0d30797 +4.2-6633c45460b0 diff -r 6633c45460b0 -r afd3ebead0fe src/openmp.h --- a/src/openmp.h Sun Jan 06 10:02:58 2013 +0100 +++ b/src/openmp.h Sun Jan 06 10:03:30 2013 +0100 @@ -306,8 +306,8 @@ const math_t infinity = std::numeric_limits<math_t>::infinity(); - int* v = new int[n]; - math_t* z = new math_t[n + 1]; + int v[n]; + math_t z[n + 1]; int k = 0; v[0] = 0; @@ -340,9 +340,6 @@ } d[q] = square(q - v[k]) + f[v[k]]; } - - delete [] v; - delete [] z; } }; |