pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Expand palloc/pg_malloc API for more type safety
7+ messages / 1 participants
[nested] [flat]

* pgsql: Expand palloc/pg_malloc API for more type safety
@ 2022-09-12 06:53  Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Eisentraut @ 2022-09-12 06:53 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/bb755632-2a43-d523-36f8-a1e7a389a907@enterprisedb.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2016055a92f26d648aba9f66d26cc0bcd1619eff

Modified Files
--------------
src/include/common/fe_memutils.h | 28 ++++++++++++++++++++++++++++
src/include/utils/palloc.h       | 22 ++++++++++++++++++++++
2 files changed, 50 insertions(+)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Expand palloc/pg_malloc API for more type safety
@ 2022-09-14 04:18  Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Eisentraut @ 2022-09-14 04:18 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2864f77556110529f294951382a8d67201244758

Modified Files
--------------
src/include/common/fe_memutils.h | 28 ++++++++++++++++++++++++++++
src/include/utils/palloc.h       | 22 ++++++++++++++++++++++
2 files changed, 50 insertions(+)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Expand palloc/pg_malloc API for more type safety
@ 2022-09-14 04:18  Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Eisentraut @ 2022-09-14 04:18 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/b7f37af7c195519a041fcc6084cff95dc5e4a76f

Modified Files
--------------
src/include/common/fe_memutils.h | 28 ++++++++++++++++++++++++++++
src/include/utils/palloc.h       | 22 ++++++++++++++++++++++
2 files changed, 50 insertions(+)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Expand palloc/pg_malloc API for more type safety
@ 2022-09-14 04:18  Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Eisentraut @ 2022-09-14 04:18 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e962235fe1f6ae79eff9b600bd37f945becec36e

Modified Files
--------------
src/include/common/fe_memutils.h | 28 ++++++++++++++++++++++++++++
src/include/utils/palloc.h       | 22 ++++++++++++++++++++++
2 files changed, 50 insertions(+)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Expand palloc/pg_malloc API for more type safety
@ 2022-09-14 04:18  Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Eisentraut @ 2022-09-14 04:18 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7dd9b469bc56f853ce2a092a6575a587a8c45ccf

Modified Files
--------------
src/include/common/fe_memutils.h | 28 ++++++++++++++++++++++++++++
src/include/utils/palloc.h       | 22 ++++++++++++++++++++++
2 files changed, 50 insertions(+)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Expand palloc/pg_malloc API for more type safety
@ 2022-09-14 04:18  Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Eisentraut @ 2022-09-14 04:18 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1728822924511e792760737aab8749e294af2c1c

Modified Files
--------------
src/include/common/fe_memutils.h | 28 ++++++++++++++++++++++++++++
src/include/utils/palloc.h       | 22 ++++++++++++++++++++++
2 files changed, 50 insertions(+)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Expand palloc/pg_malloc API for more type safety
@ 2022-09-14 04:18  Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Eisentraut @ 2022-09-14 04:18 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7fe55d5e12b66c7807d8af1f45946d7d48f5d6db

Modified Files
--------------
src/include/common/fe_memutils.h | 28 ++++++++++++++++++++++++++++
src/include/utils/palloc.h       | 22 ++++++++++++++++++++++
2 files changed, 50 insertions(+)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2022-09-14 04:18 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-09-12 06:53 pgsql: Expand palloc/pg_malloc API for more type safety Peter Eisentraut <peter@eisentraut.org>
2022-09-14 04:18 pgsql: Expand palloc/pg_malloc API for more type safety Peter Eisentraut <peter@eisentraut.org>
2022-09-14 04:18 pgsql: Expand palloc/pg_malloc API for more type safety Peter Eisentraut <peter@eisentraut.org>
2022-09-14 04:18 pgsql: Expand palloc/pg_malloc API for more type safety Peter Eisentraut <peter@eisentraut.org>
2022-09-14 04:18 pgsql: Expand palloc/pg_malloc API for more type safety Peter Eisentraut <peter@eisentraut.org>
2022-09-14 04:18 pgsql: Expand palloc/pg_malloc API for more type safety Peter Eisentraut <peter@eisentraut.org>
2022-09-14 04:18 pgsql: Expand palloc/pg_malloc API for more type safety Peter Eisentraut <peter@eisentraut.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox