Re: Don't allocate IndexAmRoutine dynamically? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Don't allocate IndexAmRoutine dynamically?
Date
Msg-id 15589.1561497912@sss.pgh.pa.us
Whole thread Raw
In response to Re: Don't allocate IndexAmRoutine dynamically?  (Andres Freund <andres@anarazel.de>)
Responses Re: Don't allocate IndexAmRoutine dynamically?
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2019-06-25 16:15:17 -0400, Tom Lane wrote:
>> One too many "consts" there.  Pointer to const object seems fine.
>> The other part is either meaningless or will cause problems.

> Yea - I was thinking of the pointer in RelationData, where having it as
> const *Routine const; would make sense (but it's annoying to do without
> invoking technically undefined behaviour, doing ugly things with memcpy
> or duplicating struct definitions).

Yeah, I think trying to make such pointer fields "const", within
structures that are otherwise not const, is just more trouble than it's
worth.  To start with, how will you assign the handler's output pointer
to such a field?

            regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Don't allocate IndexAmRoutine dynamically?
Next
From: Andres Freund
Date:
Subject: Re: Don't allocate IndexAmRoutine dynamically?