commit 476622610f3a255581307429cbce64a4a9863abd
parent 4ca18be28120ed821a928cfded25a1756034be20
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Mon, 8 Jan 2018 09:40:47 +0100
Register the steps of the random walk only in debug
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/sdis_solve_probe.c b/src/sdis_solve_probe.c
@@ -434,8 +434,10 @@ compute_temperature
struct ssp_rng* rng,
struct temperature* T)
{
+#ifndef NDEBUG
struct temperature* stack = NULL;
size_t istack;
+#endif
res_T res = RES_OK;
ASSERT(scn && fp_to_meter && rwalk && rng && T);
@@ -443,12 +445,16 @@ compute_temperature
res = T->func(scn, fp_to_meter, rwalk, rng, T);
if(res != RES_OK) goto error;
+#ifndef NDEBUG
sa_push(stack, *T);
++istack;
+#endif
} while(!T->done);
exit:
+#ifndef NDEBUG
sa_release(stack);
+#endif
return res;
error:
goto exit;