Re: Replace references to malloc() in libpq documentation with generic language

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Replace references to malloc() in libpq documentation with generic language
Дата
Msg-id 559227.1698160049@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Replace references to malloc() in libpq documentation with generic language  (Daniel Gustafsson <daniel@yesql.se>)
Ответы Re: Replace references to malloc() in libpq documentation with generic language  (Daniel Gustafsson <daniel@yesql.se>)
Список pgsql-hackers
Daniel Gustafsson <daniel@yesql.se> writes:
>> On 24 Oct 2023, at 07:13, Gurjeet Singh <gurjeet@singh.im> wrote:
>> The user does not benefit from knowing that libpq allocates some/all memory
>> using malloc(). Mentioning malloc() here has a few downsides, and almost no
>> benefits.

> I'm not entirely convinced that replacing "malloc" with "allocated on the heap"
> improves the documentation.

That was my reaction too.  The underlying storage allocator *is* malloc,
and C programmers know what that is, and I don't see how obfuscating
that improves matters.  It's true that on the miserable excuse for a
platform that is Windows, you have to use PQfreemem because of
Microsoft's inability to supply a standards-compliant implementation
of malloc.  But I'm not inclined to let that tail wag the dog.

> I do agree with this proposed change though:

> -      all the space that will be freed by <xref linkend="libpq-PQclear"/>.
> +      all the memory that will be freed by <xref linkend="libpq-PQclear"/>.

+1, seems harmless.

            regards, tom lane



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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [PATCH] Tracking statements entry timestamp in pg_stat_statements
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [PATCH] Extend ALTER OPERATOR to support adding commutator, negator, hashes, and merges