Files
magpie/internal/dirent
yetone 328dc97e28 dirent: Each lists a folder with nothing made an entry; Codex's idle check uses it
b5adaa8bd read Codex's sessions folders with dirent.Stats, and measured
on a real-account HOME it allocated about as much as the walk it
replaced (dirent.entry and nameOf 4.1 MB of 12.7 MB in 4 idle minutes):
Stats copies every name and builds a listing, for a check that keeps
none of it.

dirent.Each gives a callback each entry's name, in getattrlistbulk's
buffer, and its Stat, and stops when told; stats is now built on the
same reader. codexSessionsQuietListed makes a path for each folder and
nothing for a file.

Run:
- mote: go test -count=1 ./internal/dirent ./internal/sessions ok;
  ./internal/provider ok (141s); GOOS=windows and GOOS=linux -tags nogui
  go vet ./internal/dirent ./internal/provider ok; gofmt clean
- xiaomi-gpu (Windows): -run 'TestEach|TestCodexSessionsQuiet' ok
Broken by hand: Each copying each name (string(name)), and
TestEachIsLstatWithNothingMade is red with 302 allocations for 301
entries.
2026-11-11 08:33:52 +08:00
..