Re: [PATCH 2/2] commit-graph: propagate topo_levels slab to all chain layers
- From
Taylor Blau <ttaylorr@openai.com>
- Date
- Jul 10, 2026, 22:14 UTC
- Message-ID
- <alFuxPQQcFxseAzh@com-79390>
- In-Reply-To
- <CAL71e4OuU1+KHd0TrcxDX2dyoWEJXmi86m8u+E7vtxhcSF6M1Q@mail.gmail.com>
On Tue, Jul 07, 2026 at 04:57:13PM +0200, Kristofer Karlsson wrote:
Show 14 quoted lines
> (b) Move topo_levels to struct object_database. Since > fill_commit_graph_info() can already reach the odb via > g->odb_source->odb, no signature changes are needed. > The write side becomes a single assignment: > > ctx.r->objects->topo_levels = &topo_levels; > > and cleanup becomes: > > ctx.r->objects->topo_levels = NULL; > > No chain walk needed and the diff is fairly small. > I am not sure about the semantics of it though -- should the odb > have a reference to topo_levels?
This seems to be the most promising approach, though I'd be curious what Patrick's thoughts are. The commit-slab API is really a property of the object database, but we treat these as a global as I do not recall them yet being touched by the ODB refactoring effort.
Show 5 quoted lines
> [...] > > I have a prototype of (b) that compiles and passes the test suite. > > For now though, I think the minimal bugfix is the right thing to do.
Agreed.
Thanks, Taylor