Re: Fix incorrect comments in tuplesort.c
| От | David Rowley |
|---|---|
| Тема | Re: Fix incorrect comments in tuplesort.c |
| Дата | |
| Msg-id | CAApHDvrN3PNF0G4uxzT87i5034wYLG1MPZtzaCzjDaX8iJ3tOQ@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: Fix incorrect comments in tuplesort.c ("cca5507" <cca5507@qq.com>) |
| Ответы |
Re: Fix incorrect comments in tuplesort.c
|
| Список | pgsql-hackers |
On Sun, 7 Dec 2025 at 21:34, cca5507 <cca5507@qq.com> wrote: > I find that the initial size of memtuples array must be more than ALLOCSET_SEPARATE_THRESHOLD > is not for lower overhead of allocation, but for a bug fixed in 8ea3e7a75c0d22c41c57f59c8b367059b97d0b66. > > Attach a new patch. I find the current comment perfectly understandable and the text you're proposing to be incorrect. What you might be missing is that with aset.c, a palloc() request above ALLOCSET_SEPARATE_THRESHOLD is certain to require a malloc() and a dedicated block. Sizes under that may be able to use an existing AllocBlock. The comment is effectively explaining that we don't want to make the array big enough so that a malloc will always be required. You may need to read AllocSetContextCreateInternal() around where allocChunkLimit is being set to understand what this is all about. David
В списке pgsql-hackers по дате отправления: