diff options
| author | Patrick Steinhardt <ps@pks.im> | 2024-08-22 08:34:44 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-08-22 07:59:46 -0700 |
| commit | b8ca235ca5fad0421766db7fe2c0f52c6707bf8e (patch) | |
| tree | 7ef8deef1d6c82495be692d70ab2017d911cfc7b /reftable/reader.h | |
| parent | 6631ed3ce706a82ee43aa70afb38a236bf69d645 (diff) | |
| download | git-b8ca235ca5fad0421766db7fe2c0f52c6707bf8e.tar.xz | |
reftable/merged: stop using generic tables in the merged table
The merged table provides access to a reftable stack by merging the
contents of those tables into a virtual table. These subtables are being
tracked via `struct reftable_table`, which is a generic interface for
accessing either a single reftable or a merged reftable. So in theory,
it would be possible for the merged table to merge together other merged
tables.
This is somewhat nonsensical though: we only ever set up a merged table
over normal reftables, and there is no reason to do otherwise. This
generic interface thus makes the code way harder to follow and reason
about than really necessary. The abstraction layer may also have an
impact on performance, even though the extra set of vtable function
calls probably doesn't really matter.
Refactor the merged tables to use a `struct reftable_reader` for each of
the subtables instead, which gives us direct access to the underlying
tables. Adjust names accordingly.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reftable/reader.h')
| -rw-r--r-- | reftable/reader.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/reftable/reader.h b/reftable/reader.h index e869165f23..a2c204d523 100644 --- a/reftable/reader.h +++ b/reftable/reader.h @@ -57,6 +57,10 @@ int init_reader(struct reftable_reader *r, struct reftable_block_source *source, void reader_close(struct reftable_reader *r); const char *reader_name(struct reftable_reader *r); +void reader_init_iter(struct reftable_reader *r, + struct reftable_iterator *it, + uint8_t typ); + /* initialize a block reader to read from `r` */ int reader_init_block_reader(struct reftable_reader *r, struct block_reader *br, uint64_t next_off, uint8_t want_typ); |
