diff --git a/doc.go b/doc.go index 6180994..949e257 100644 --- a/doc.go +++ b/doc.go @@ -23,8 +23,9 @@ package fejkdata // `Generator.Fake`, `FakeRecord`, `Template.Fake` and `RecordTemplate.Fake` // start one each, `FakeStruct` one per record, and `expandAnew` one per // iteration of a `template.repeat`. -// - hold — one expansion keeping one draw of a name, so every route to it reads -// that value: `formatOps.held`, `formatOps.keepsHold`, `heldCheck`. +// - hold — keeping one draw of a name, so every route to it reads that value: +// an expansion holds a sibling path's head and an operand's field, its draw +// group a reference path's: `formatOps.held`, `formatOps.keepsHold`, `heldCheck`. // - memo — what a hold or a draw group keeps its draws in, the variant drawn at // each level and the value each path read: `drawMemo`, `readMemo`. // - draw group — reference draws kept apart inside one render: diff --git a/docs/decisions.md b/docs/decisions.md index 4acfdcf..4dcd1b5 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -680,7 +680,7 @@ Re-tested 2026-09-29 by collapsing them into one loop switching on a mode field. Goals 2 and 11: `pathCheck`, `pathCover`, `pathProbe` and `pathDraw` stay four loops. One loop fails `perf_test.go`: the check's leaves, the probe's selectors and the errors naming a level leak the walker's contents, and Go tracks a struct's fields as one, so -the draw's pins, arm and hold leak with them. Held by pointer, a repeat of a reference +the draw's pins, arm and memo leak with them. Held by pointer, a repeat of a reference path rose from 66 to 106 allocations; copied into the walker by value, `BenchmarkHeld` rose from 5 to 9. A call through an interface or a type parameter leaks the walker the same way. Valid while Go's escape analysis tracks a struct's fields as diff --git a/draws.go b/draws.go index eb5e4f7..a7f5894 100644 --- a/draws.go +++ b/draws.go @@ -37,7 +37,7 @@ type renderDraws struct { // renderScope is where a render reads its reference paths: its reference draws, in the draw group of the // template rendering; and row, the row of the table rendering, which its columns read. It passes // by value, and what is read from it reaches a map key, an interface or a func value only as a -// copy; else sc, and with it every render's draws, move to the heap. +// copy; else sc, and with it every render's draws, moves to the heap. type renderScope struct { draws *renderDraws group string diff --git a/record.go b/record.go index 77737c8..4d76149 100644 --- a/record.go +++ b/record.go @@ -260,7 +260,7 @@ func recordOf(n node) (*template, []Column, error) { } // renderRecord draws each column once, in the name order recordOf fixed, as one render -// over sc's hold; a table's columns read the row pinned there. +// over sc's draws; a table's columns read the row pinned there. func renderRecord(s *generatorState, t *template, columns []Column, sc renderScope) *Record { sc = sc.in(t) if t.site.row == formatRow {