Re: Why the asprintf patch is still breaking the buildfarm

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Why the asprintf patch is still breaking the buildfarm
Дата
Msg-id CAApHDvqNVSc=DYYuvt13YyHmrhCvYH4wb_o6Ha1Gz+sCAvUdKA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Why the asprintf patch is still breaking the buildfarm  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Why the asprintf patch is still breaking the buildfarm  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Wed, Oct 23, 2013 at 4:00 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Yeah.  As a separate matter, it might be useful to revise stringinfo.c
and the asprintf code so that *if* the returned value is larger than the
given buffer size, we use it as a guide to resizing, avoiding the possible
need to loop multiple times to make the buffer large enough.  And we could
also improve our own implementation of snprintf to follow the C99 spec.


Attached is a draft patch which implements this. 
I didn't bother making the translation macros make use of the extra data as I
didn't think we would have many translations long enough to take advantage of it.

I think it's a good idea to take advantage of the buffer size if vsnprintf() has gone
to the trouble of working out what is needed for us. It seems quite wasteful to throw this information away.

Comments are welcome.

Regards

David

Вложения

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

Предыдущее
От: Samrat Revagade
Дата:
Сообщение: Re: Review of pg_rewind
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: all_visible replay aborting due to uninitialized pages