Re: Non-decimal integer literals

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: Non-decimal integer literals
Дата
Msg-id CAEZATCXa1cEAp-GH8FVgwn3JRg55_tK6TSCrifa4tXmm34dXAw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Non-decimal integer literals  (David Rowley <dgrowleyml@gmail.com>)
Ответы Re: Non-decimal integer literals  (David Rowley <dgrowleyml@gmail.com>)
Список pgsql-hackers
On Wed, 23 Nov 2022 at 08:56, David Rowley <dgrowleyml@gmail.com> wrote:
>
> On Wed, 23 Nov 2022 at 21:54, David Rowley <dgrowleyml@gmail.com> wrote:
> > I wonder if you'd be better off with something like:
> >
> >         while (*ptr && isxdigit((unsigned char) *ptr))
> >         {
> >             if (unlikely(tmp & UINT64CONST(0xF000000000000000)))
> >                 goto out_of_range;
> >
> >             tmp = (tmp << 4) | hexlookup[(unsigned char) *ptr++];
> >         }
>
> Here's a delta diff with it changed to work that way.
>

This isn't correct, because those functions are meant to accumulate a
negative number in "tmp".

The overflow check can't just ignore the final digit either, so I'm
not sure how much this would end up saving once those issues are
fixed.

Regards,
Dean



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: ExecRTCheckPerms() and many prunable partitions
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Reducing power consumption on idle servers