Re: pgsql: Move memory management away from writetup() and tuplesort_put*()

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: pgsql: Move memory management away from writetup() and tuplesort_put*()
Дата
Msg-id CAApHDvrZ9Ky2LcWwcKsbdYChA850JE5qS=kGJiTNWS8mbBXZHw@mail.gmail.com
обсуждение исходный текст
Ответ на pgsql: Move memory management away from writetup() and tuplesort_put*()  (Alexander Korotkov <akorotkov@postgresql.org>)
Ответы Re: pgsql: Move memory management away from writetup() and tuplesort_put*()  (Alexander Korotkov <aekorotkov@gmail.com>)
Список pgsql-committers
On Wed, 27 Jul 2022 at 17:29, Alexander Korotkov
<akorotkov@postgresql.org> wrote:
> src/backend/utils/sort/tuplesort.c | 78 ++++++++++++++++----------------------

I was wondering about the following comment that this commit added:

+/*
+ * Write a stored tuple onto tape.tuple.  Unless the slab allocator is
+ * used, after writing the tuple, pfree() the out-of-line data (not the
+ * SortTuple struct!), and increase state->availMem by the amount of
+ * memory space thereby released.
+ */
static void
writetuple(Tuplesortstate *state, LogicalTape *tape, SortTuple *stup)

LogicalTable has no field named 'tuple' so I'm thinking the
"tape.tuple" is a mistake?

If so, maybe the comment should be:

/*
 * Write 'stup' out onto 'tape' and, unless using the slab allocator,
pfree stup's
 * tuple and adjust the memory accounting accordingly.
*/

David



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

Предыдущее
От: Thomas Munro
Дата:
Сообщение: pgsql: Remove configure probe for sockaddr_in6 and require AF_INET6.
Следующее
От: John Naylor
Дата:
Сообщение: pgsql: Add optimized functions for linear search within byte arrays