Avoid type cheats for invalid dsa_handles and dshash_table_handles.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 3b4ac33254e1291f0b3c94f1cb770137c418ce2e
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2023-01-25T16:48:38Z
Releases: 16.0
Avoid type cheats for invalid dsa_handles and dshash_table_handles.

Invent separate macros for "invalid" values of these types, so that
we needn't embed knowledge of their representations into calling code.
These are all zeroes anyway ATM, so this is not fixing any live bug,
but it makes the code cleaner and more future-proof.

I (tgl) also chose to move DSM_HANDLE_INVALID into dsm_impl.h,
since it seems like it should live beside the typedef for dsm_handle.

Hou Zhijie, Nathan Bossart, Kyotaro Horiguchi, Tom Lane

Discussion: https://postgr.es/m/OS0PR01MB5716860B1454C34E5B179B6694C99@OS0PR01MB5716.jpnprd01.prod.outlook.com

Files

Discussion