Re: possible repalloc() in icu_convert_case()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: possible repalloc() in icu_convert_case()
Дата
Msg-id 172640.1617553238@sss.pgh.pa.us
обсуждение исходный текст
Ответ на possible repalloc() in icu_convert_case()  (Anton Voloshin <a.voloshin@postgrespro.ru>)
Ответы Re: possible repalloc() in icu_convert_case()
Список pgsql-hackers
Anton Voloshin <a.voloshin@postgrespro.ru> writes:
> in src/backend/utils/adt/formatting.c, in icu_convert_case() I see:
>      if (status == U_BUFFER_OVERFLOW_ERROR)
>      {
>          /* try again with adjusted length */
>          pfree(*buff_dest);
>          *buff_dest = palloc(len_dest * sizeof(**buff_dest));
>          ...

> Is there any reason why this should not be repalloc()?

repalloc is likely to be more expensive, since it implies copying
data which isn't helpful here.  I think this code is fine as-is.

            regards, tom lane



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

Предыдущее
От: Zhihong Yu
Дата:
Сообщение: Re: Allow batched insert during cross-partition updates
Следующее
От: Tom Lane
Дата:
Сообщение: Re: ModifyTable overheads in generic plans