On Sun, Dec 7, 2025 at 3:09 PM David Rowley <[email protected]> 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;

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.

?

David J.

Reply via email to