get rid of Pointer type, mostly - Mailing list pgsql-hackers

From Peter Eisentraut
Subject get rid of Pointer type, mostly
Date
Msg-id 4154950a-47ae-4223-bd01-1235cc50e933@eisentraut.org
Whole thread Raw
Responses Re: get rid of Pointer type, mostly
Re: get rid of Pointer type, mostly
Re: get rid of Pointer type, mostly
List pgsql-hackers
In a previous thread[0], the question was asked, 'Why do we bother with 
a "Pointer" type?'.  So I looked into get rid of it.

There are two stages to this.  One is changing all code that wants to do 
pointer arithmetic to use char * instead of relying on Pointer being 
char *.  Then we can change Pointer to be void * and remove a bunch of 
casts.

The second is getting rid of uses of Pointer for variables where you 
might as well use void * directly.  These are actually not that many.

This gets rid of all uses, except in the GIN code, which is full of 
Pointer use, and it's part of the documented API.  I'm not touching 
that, not least because this kind of code

     Pointer   **extra_data = (Pointer **) PG_GETARG_POINTER(4);

needs more brain-bending to understand that I'm prepared to spend.  So 
as far as I'm concerned, the pointer type can continue to exist as a 
curiosity of the GIN API, but in all other places, it wasn't really 
doing much of anything anyway.


[0]: 
https://www.postgresql.org/message-id/CA%2BhUKG%2BNFKnr%3DK4oybwDvT35dW%3DVAjAAfiuLxp%2B5JeZSOV3nBg%40mail.gmail.com
Attachment

pgsql-hackers by date:

Previous
From: Álvaro Herrera
Date:
Subject: Re: [PATCH] Expose checkpoint timestamp and duration in pg_stat_checkpointer
Next
From: Bertrand Drouvot
Date:
Subject: Remove useless casting to the same type