On Wed, Aug 16, 2023 at 12:17 AM Nathan Bossart <
nathandbossart@gmail.com> wrote:
>
> On Tue, Aug 15, 2023 at 01:53:25PM +0700, John Naylor wrote:
> > - *ptr = '\0';
> > + Assert(base == 2 || base == 8 || base == 16);
> >
> > + *ptr = '\0';
> >
> > Spurious whitespace change?
>
> I think this might just be a weird artifact of the diff algorithm.
Don't believe everything you think. :-)
```
*ptr = '\0';
do
```
to
```
*ptr = '\0';
do
```
> > - char buf[32]; /* bigger than needed, but reasonable */
> > + char *buf = palloc(sizeof(uint64) * BITS_PER_BYTE + 1);
> >
> > Why is this no longer allocated on the stack? Maybe needs a comment about
> > the size calculation.
>
> It really should be. IIRC I wanted to avoid passing a pre-allocated buffer
> to convert_to_base(), but I don't remember why. I fixed this in v5.
Now I'm struggling to understand why each and every instance has its own nominal buffer, passed down to the implementation. All we care about is the result -- is there some reason not to confine the buffer declaration to the general implementation?
--
John Naylor
EDB:
http://www.enterprisedb.com