Re: [PATCH v2 08/10] reftable/writer: optimize allocations by using a scratch buffer
- From
- Patrick Steinhardt <pks@pks.im>
- Date
- Nov 25, 2024, 05:52 UTC
- Message-ID
- <Z0QQlPXc0gcNohhp@pks.im>
- In-Reply-To
- <CAP8UFD35YvWgQUcXT4z6k1foH4wN31KX1Xg_09GR16POs51NGg@mail.gmail.com>
On Wed, Nov 20, 2024 at 11:21:54AM +0100, Christian Couder wrote:
Show 15 quoted lines
> On Wed, Nov 20, 2024 at 9:07 AM Patrick Steinhardt <ps@pks.im> wrote:
>
> > diff --git a/reftable/writer.h b/reftable/writer.h
> > index e8a6fbb78543e6e56920a2999601db0db9fe4d97..421a897dccd85ad0532860ff1b4f38b2813d438d 100644
> > --- a/reftable/writer.h
> > +++ b/reftable/writer.h
> > @@ -20,6 +20,7 @@ struct reftable_writer {
> > void *write_arg;
> > int pending_padding;
> > struct reftable_buf last_key;
> > + struct reftable_buf buf;
>
> Nit: It would be nice to add a comment, so that readers don't have to
> look at .c files, or the commit message, to find what this field is
> used for.Fair enough. I'll also rename it to `scratch` while at it to clarify its intent a bit. Other parts of the reftable library already use that name.
Patrick