postgresql/src/include/common
Peter Eisentraut 7fe55d5e12 Expand palloc/pg_malloc API for more type safety
This adds additional variants of palloc, pg_malloc, etc. that
encapsulate common usage patterns and provide more type safety.

Specifically, this adds palloc_object(), palloc_array(), and
repalloc_array(), which take the type name of the object to be
allocated as its first argument and cast the return as a pointer to
that type.  There are also palloc0_object() and palloc0_array()
variants for initializing with zero, and pg_malloc_*() variants of all
of the above.

Inspired by the talloc library.

This is backpatched from master so that future backpatchable code can
make use of these APIs.  This patch by itself does not contain any
users of these APIs.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/bb755632-2a43-d523-36f8-a1e7a389a907@enterprisedb.com
2022-09-14 06:04:24 +02:00
..
archive.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
base64.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
checksum_helper.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
compression.h Simplify handling of compression level with compression specifications 2022-09-14 12:17:03 +09:00
config_info.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
connect.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
controldata_utils.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
cryptohash.h Improve error handling of cryptohash computations 2022-01-11 09:55:16 +09:00
fe_memutils.h Expand palloc/pg_malloc API for more type safety 2022-09-14 06:04:24 +02:00
file_perm.h Apply PGDLLIMPORT markings broadly. 2022-04-08 08:16:38 -04:00
file_utils.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
hashfn.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
hmac.h Improve error handling of HMAC computations 2022-01-13 16:17:21 +09:00
int.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
int128.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
ip.h Remove IS_AF_UNIX macro 2022-02-15 10:16:34 +01:00
jsonapi.h Apply PGDLLIMPORT markings broadly. 2022-04-08 08:16:38 -04:00
keywords.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
kwlookup.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
link-canary.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
logging.h Remove PGDLLIMPORT marker from __pg_log_level 2022-05-13 09:39:13 +09:00
md5.h Improve error handling of cryptohash computations 2022-01-11 09:55:16 +09:00
openssl.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_lzcompress.h Apply PGDLLIMPORT markings broadly. 2022-04-08 08:16:38 -04:00
pg_prng.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
relpath.h Apply PGDLLIMPORT markings broadly. 2022-04-08 08:16:38 -04:00
restricted_token.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
saslprep.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
scram-common.h Improve error handling of HMAC computations 2022-01-13 16:17:21 +09:00
sha1.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
sha2.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
shortest_dec.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
string.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
unicode_combining_table.h Update Unicode data to Unicode 14.0.0 2021-09-15 08:16:44 +02:00
unicode_east_asian_fw_table.h Update Unicode data to Unicode 14.0.0 2021-09-15 08:16:44 +02:00
unicode_norm.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
unicode_norm_hashfunc.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
unicode_norm_table.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
unicode_normprops_table.h Update Unicode data to Unicode 14.0.0 2021-09-15 08:16:44 +02:00
username.h Update copyright for 2022 2022-01-07 19:04:57 -05:00