git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 1c99cde) | patch
Refactor ListenSocket array.
Thu, 5 Oct 2023 12:05:25 +0000 (15:05 +0300)
Thu, 5 Oct 2023 12:05:25 +0000 (15:05 +0300)
commit e29c46439511a2ba8b447079f2308384a4228c92
Refactor ListenSocket array.

Keep track of the used size of the array. That avoids looping through
the whole array in a few places. It doesn't matter from a performance
point of view since the array is small anyway, but this feels less
surprising and is a little less code. Now that we have an explicit
NumListenSockets variable that is statically initialized to 0, we
don't need the loop to initialize the array.

Allocate the array in PostmasterContext. The array isn't needed in
child processes, so this allows reusing that memory. We could easily
make the array resizable now, but we haven't heard any complaints
about the current 64 sockets limit.

Discussion: https://www.postgresql.org/message-id/7bb7ad65-a018-2419-742f-fa5fd877d338@iki.fi
src/backend/libpq/pqcomm.c diff | blob | blame | history
src/backend/postmaster/postmaster.c diff | blob | blame | history
src/include/libpq/libpq.h diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /