aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/array_userfuncs.c
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2023-11-07 11:16:43 +1300
committerDavid Rowley <drowley@postgresql.org>2023-11-07 11:16:43 +1300
commitac7d6f5f831e4dd83d891b95560d514b2d722d98 (patch)
tree1e374bd68a34fcff5cdc68394f6022a6fe7475c5 /src/backend/utils/adt/array_userfuncs.c
parent18b585155a891784ca8985f595ebc0dde94e0d43 (diff)
downloadpostgresql-ac7d6f5f831e4dd83d891b95560d514b2d722d98.tar.gz
postgresql-ac7d6f5f831e4dd83d891b95560d514b2d722d98.zip
Make use of initReadOnlyStringInfo() in more places
f0efa5aec introduced the concept of "read-only" StringInfos which makes use of an existing, possibly not NUL terminated, buffer. Here we adjust two places that make use of StringInfos to receive data to avoid using appendBinaryStringInfo() in cases where a NUL termination character is not required. This saves a possible palloc() and saves having to needlessly memcpy() from one buffer to another. Here we adjust two places which were using appendBinaryStringInfo(). Neither of these cases seem particularly performance-critical. In the case of XLogWalRcvProcessMsg(), the appendBinaryStringInfo() was only appending 24 bytes. The change made here does mean that we can get rid of the incoming_message global variable and make that local instead. The apply_spooled_messages() case applies in logical decoding when applying (possibly large) changes which have been serialized to a file. Reviewed-by: Amit Kapila Discussion: https://postgr.es/m/CAApHDvoxYUDHwqPf-ShvchsERf1RzmkGoLwg63JNvHCkDCuyKQ@mail.gmail.com
Diffstat (limited to 'src/backend/utils/adt/array_userfuncs.c')
0 files changed, 0 insertions, 0 deletions