Re: Don't allocate IndexAmRoutine dynamically?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Don't allocate IndexAmRoutine dynamically?
Date: 2019-06-25 21:25:12
Message-ID: 15589.1561497912@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2019-06-25 21:42:52 Re: Don't allocate IndexAmRoutine dynamically?
Previous Message Andres Freund 2019-06-25 21:06:09 Re: Don't allocate IndexAmRoutine dynamically?