1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-18 02:02:55 +03:00

Remove Item type

This type is just char * underneath, it provides no real value, no
type safety, and just makes the code one level more mysterious.  It is
more idiomatic to refer to blobs of memory by a combination of void *
and size_t, so change it to that.

Also, since this type hides the pointerness, we can't apply qualifiers
to what is pointed to, which requires some unconstify nonsense.  This
change allows fixing that.

Extension code that uses the Item type can change its code to use
void * to be backward compatible.

Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Peter Geoghegan <pg@bowt.ie>
Discussion: https://www.postgresql.org/message-id/flat/c75cccf5-5709-407b-a36a-2ae6570be766@eisentraut.org
This commit is contained in:
Peter Eisentraut
2025-10-27 09:54:16 +01:00
parent 64d2b0968e
commit 76acf4b722
29 changed files with 102 additions and 178 deletions

View File

@@ -191,7 +191,7 @@ PageIsVerified(PageData *page, BlockNumber blkno, int flags, bool *checksum_fail
*/
OffsetNumber
PageAddItemExtended(Page page,
Item item,
const void *item,
Size size,
OffsetNumber offsetNumber,
int flags)
@@ -1402,7 +1402,7 @@ PageIndexTupleDeleteNoCompact(Page page, OffsetNumber offnum)
*/
bool
PageIndexTupleOverwrite(Page page, OffsetNumber offnum,
Item newtup, Size newsize)
const void *newtup, Size newsize)
{
PageHeader phdr = (PageHeader) page;
ItemId tupid;