Re: Fix incorrect comments in tuplesort.c
| От | David G. Johnston |
|---|---|
| Тема | Re: Fix incorrect comments in tuplesort.c |
| Дата | |
| Msg-id | CAKFQuwaEXRcvDn7S3o5hEnB9Yt5jgecbfyGY+gLohAcV2p=Pzg@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: Fix incorrect comments in tuplesort.c (David Rowley <dgrowleyml@gmail.com>) |
| Ответы |
Re: Fix incorrect comments in tuplesort.c
|
| Список | pgsql-hackers |
On Sun, Dec 7, 2025 at 3:09 PM David Rowley <dgrowleyml@gmail.com> wrote:
The comment is effectively
explaining that we don't want to make the array big enough so that a
malloc will always be required.
Doesn't what you are saying contradict both the formula (the +1 post-division) and the comments:
/*
* Initial size of array must be more than ALLOCSET_SEPARATE_THRESHOLD;
* see comments in grow_memtuples().
*/
state->memtupsize = INITIAL_MEMTUPSIZE;
state->memtuples = NULL;
* Initial size of array must be more than ALLOCSET_SEPARATE_THRESHOLD;
* see comments in grow_memtuples().
*/
state->memtupsize = INITIAL_MEMTUPSIZE;
state->memtuples = NULL;
and in grow_memtuples:
* That shouldn't happen because we chose the
* initial array size large enough to ensure that palloc will be treating
* both old and new arrays as separate chunks.
* initial array size large enough to ensure that palloc will be treating
* both old and new arrays as separate chunks.
?
David J.
В списке pgsql-hackers по дате отправления: