Files
scriptc/packages
Chris Tate a8d154f370 Report what keeps a region with SCRIPTC_REGION_DEBUG
A released region that something outside still refers to is kept, and
SCRIPTC_REGION_STATS only said how many references the walk could not
explain. In a build with --optimization=dev (or --sanitize), setting
SCRIPTC_REGION_DEBUG=1 (or a larger number, the line limit) makes each
attempt that keeps a region also print what keeps it:

- per chunk, the references to its objects that the walk did not find
  (from variables, other regions or objects it does not walk), with the
  classes the chunk holds, since counts are kept per chunk;
- each ordinary object the region owns that is referenced from outside,
  named by the region class and field it was reached through, with its
  reference count and the references the walk found.

The emitted region class descriptors gain the names of the fields their
visits report, in visit order. Debug walks give every owned object an
entry, so that each one records where the walk first reached it. The
bookkeeping is compiled only into unoptimized and RC-audit runtimes:
compiled in, it made the release walk 6.5% slower even with the variable
unset. Optimized runtimes walk as before and, when the variable is set,
say once that the reports need a dev build. Retains, releases and
allocation are unchanged.

Adds corpus program 5703.
2026-10-16 00:35:06 -05:00
..
2026-10-15 11:23:16 -05:00
2026-10-15 11:23:16 -05:00
2026-10-15 11:23:16 -05:00
2026-10-15 11:23:16 -05:00
2026-10-15 11:23:16 -05:00
2026-10-15 11:23:16 -05:00
2026-10-15 11:23:16 -05:00
2026-10-15 11:23:16 -05:00
2026-10-15 11:23:16 -05:00
2026-10-15 11:23:16 -05:00
2026-10-15 11:23:16 -05:00
2026-10-15 11:23:16 -05:00
2026-10-15 11:23:16 -05:00
2026-10-15 11:23:16 -05:00
2026-10-15 11:23:16 -05:00
2026-10-15 11:23:16 -05:00
2026-10-15 21:48:48 -05:00
2026-10-15 11:23:16 -05:00
2026-10-15 11:23:16 -05:00
2026-10-15 11:23:16 -05:00
2026-10-15 11:23:16 -05:00
2026-10-15 11:23:16 -05:00
2026-10-15 11:23:16 -05:00
2026-10-15 11:23:16 -05:00
2026-10-15 21:48:48 -05:00
2026-10-15 19:13:52 -05:00
2026-10-15 11:23:16 -05:00
2026-10-15 11:23:16 -05:00
2026-10-15 11:23:16 -05:00