diff options
| author | Simon Tatham <anakin@pobox.com> | 2023-04-20 13:13:47 +0100 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2023-04-20 14:28:22 +0100 |
| commit | 16f997d34c7b435d3fcf5774c700579e188b017f (patch) | |
| tree | 952e854fdaf51a53996a7e39e821669633a486ac /range.c | |
| parent | 6c02b72d766fcb6a9598bdde80294a41e53cd02c (diff) | |
| download | puzzles-16f997d34c7b435d3fcf5774c700579e188b017f.zip puzzles-16f997d34c7b435d3fcf5774c700579e188b017f.tar.gz puzzles-16f997d34c7b435d3fcf5774c700579e188b017f.tar.bz2 puzzles-16f997d34c7b435d3fcf5774c700579e188b017f.tar.xz | |
Stop putting dsfs in existing scratch int arrays.
I'm going to work towards turning 'dsf' into an opaque type, so that I
can improve its implementation without breaking clients. The first
step is to deal manually with puzzles that currently reuse a single
array of ints for multiple purposes, some of which are dsf and some
are not.
In divvy_rectangle_attempt, 'tmp' was used as an int array and later a
dsf, and I've made a new 'tmpdsf' to be the latter.
In Dominosa, solver->pc_scratch2 was sometimes a dsf, and now there's
a new solver->dsf_scratch.
In Map, parse_edge_list() needed a dsf internally and then never
exported it; it expected to be passed an array of 2*w*h ints and used
the second half as a dsf. Now it expects only w*h ints, and allocates
its own dsf internally, freeing it again before returning.
And in Tents, find_errors() was allocating a single block of 2*w*h
ints and using the second half of it as a dsf, apparently just to save
one malloc. Now we malloc and free the dsf separately.
Diffstat (limited to 'range.c')
0 files changed, 0 insertions, 0 deletions