Fixed uninitialized mtortoise blocks

A simple but nasty typo! Quite confusing to figure out.

Valgrind was quick to highlight that mtortoise was uninitialized, but
without any sort of debugger support, it took many _many_ rereadings of
the code to figure out what was actually going wrong. I even started to
wonder if C's union aliasing rules were the culprit.

To make matters worse, I only noticed Valgrind's warning because I was
trying to find a heisenbug that turned out to be unrelated.

Code changes minimal:

                    code          stack          ctx
  before:          35144           2136          660
  after:           35148 (+0.0%)   2136 (+0.0%)  660 (+0.0%)

                    code          stack          ctx
  gbmap before:    38384           2144          776
  gbmap after:     38388 (+0.0%)   2144 (+0.0%)  776 (+0.0%)

                    code          stack          ctx
  preerase before: 38924           2168          796
  preerase after:  38928 (+0.0%)   2168 (+0.0%)  796 (+0.0%)
This commit is contained in:
Christopher Haster
2025-12-31 12:25:49 -06:00
parent 75875bc374
commit dfc57dda60
+1 -1
View File
@@ -9825,7 +9825,7 @@ again:;
// setup mtortoise to detect cycles
mtrv->u.mtortoise.blocks[0] = mtrv->h.mdir.r.blocks[0];
mtrv->u.mtortoise.blocks[0] = mtrv->h.mdir.r.blocks[1];
mtrv->u.mtortoise.blocks[1] = mtrv->h.mdir.r.blocks[1];
mtrv->u.mtortoise.dist = 0;
mtrv->u.mtortoise.nlog2 = 0;