postgresql/src/common
Michael Paquier 0c3c5c3b06 Use palloc_object() and palloc_array() in more areas of the tree
The idea is to encourage more the use of these new routines across the
tree, as these offer stronger type safety guarantees than palloc().

The following paths are included in this batch, treating all the areas
proposed by the author for the most trivial changes, except src/backend
(by far the largest batch):
src/bin/
src/common/
src/fe_utils/
src/include/
src/pl/
src/test/
src/tutorial/

Similar work has been done in 31d3847a37.

The code compiles the same before and after this commit, with the
following exceptions due to changes in line numbers because some of the
new allocation formulas are shorter:
blkreftable.c
pgfnames.c
pl_exec.c

Author: David Geier <geidav.pg@gmail.com>
Discussion: https://postgr.es/m/ad0748d4-3080-436e-b0bc-ac8f86a3466a@gmail.com
2025-12-09 14:53:17 +09:00
..
unicode Use C11 char16_t and char32_t for Unicode code points. 2025-10-29 14:17:13 -07:00
.gitignore Replace the data structure used for keyword lookup. 2019-01-06 17:02:57 -05:00
archive.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
base64.c Use 'void *' for arbitrary buffers, 'uint8 *' for byte arrays 2025-05-08 22:01:25 +03:00
binaryheap.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
blkreftable.c Use palloc_object() and palloc_array() in more areas of the tree 2025-12-09 14:53:17 +09:00
checksum_helper.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
compression.c Fix some cases of indirectly casting away const. 2025-12-05 11:17:23 -05:00
config_info.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
controldata_utils.c Use XLOG_CONTROL_FILE macro consistently for control file name. 2025-04-07 09:27:33 +09:00
cryptohash.c Revert "Make some use of anonymous unions [pgcrypto]" 2025-09-30 13:12:16 +02:00
cryptohash_openssl.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
d2s.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
d2s_full_table.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
d2s_intrinsics.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
digit_table.h Change floating-point output format for improved performance. 2019-02-13 15:20:33 +00:00
encnames.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
exec.c Fix compiler warnings around _CRT_glob 2025-10-01 17:13:52 +02:00
f2s.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
fe_memutils.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
file_perm.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
file_utils.c Replace off_t by pgoff_t in I/O routines 2025-11-13 12:41:40 +09:00
hashfn.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
hmac.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
hmac_openssl.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
ip.c Document that pg_getaddrinfo_all does not accept null hints 2025-11-13 16:35:07 +01:00
jsonapi.c With GB18030, prevent SIGSEGV from reading past end of allocation. 2025-05-05 04:52:04 -07:00
keywords.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
kwlookup.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
link-canary.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
logging.c Replace pg_restrict by standard restrict 2025-10-29 07:52:58 +01:00
Makefile Don't put library-supplied -L/-I switches before user-supplied ones. 2025-07-29 15:17:40 -04:00
md5.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
md5_common.c Use 'void *' for arbitrary buffers, 'uint8 *' for byte arrays 2025-05-08 22:01:25 +03:00
md5_int.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
parse_manifest.c Use palloc_object() and palloc_array() in more areas of the tree 2025-12-09 14:53:17 +09:00
percentrepl.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_get_line.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_lzcompress.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_prng.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
pgfnames.c Use palloc_object() and palloc_array() in more areas of the tree 2025-12-09 14:53:17 +09:00
psprintf.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
relpath.c Change relpath() et al to return path by value 2025-02-25 09:02:07 -05:00
restricted_token.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
rmtree.c Use palloc_object() and palloc_array() in more areas of the tree 2025-12-09 14:53:17 +09:00
ryu_common.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
saslprep.c Use C11 char16_t and char32_t for Unicode code points. 2025-10-29 14:17:13 -07:00
scram-common.c Use 'void *' for arbitrary buffers, 'uint8 *' for byte arrays 2025-05-08 22:01:25 +03:00
sha1.c Remove useless casting to same type 2025-12-02 10:09:32 +01:00
sha1_int.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
sha2.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
sha2_int.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
sprompt.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
string.c Replace pg_restrict by standard restrict 2025-10-29 07:52:58 +01:00
stringinfo.c Use palloc_object() and palloc_array() in more areas of the tree 2025-12-09 14:53:17 +09:00
unicode_case.c Use C11 char16_t and char32_t for Unicode code points. 2025-10-29 14:17:13 -07:00
unicode_category.c Use C11 char16_t and char32_t for Unicode code points. 2025-10-29 14:17:13 -07:00
unicode_norm.c Use C11 char16_t and char32_t for Unicode code points. 2025-10-29 14:17:13 -07:00
username.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
wait_error.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
wchar.c With GB18030, prevent SIGSEGV from reading past end of allocation. 2025-05-05 04:52:04 -07:00