Re: GiST: memory allocation, cleanup

From: Neil Conway <neilc(at)samurai(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches <pgsql-patches(at)postgresql(dot)org>, Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
Subject: Re: GiST: memory allocation, cleanup
Date: 2004-11-07 11:25:41
Message-ID: 418E0635.1040301@samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Tom Lane wrote:
> I think you can assume that noplace else in the backend will invoke the
> sk_func, period.

Great, thanks for the info.

>>- mark the array that indicates NULLs that is passed to
>>index_formtuple() as 'const', and fix the resulting fallout
>
> I'm a bit dubious about this, mainly because you did not likewise
> const-ify the other input arguments; it seems confusing to do a partial
> const-ification.

Well, "partial const-ification" is the rule rather than the exception in
the backend right now. I'll take a look at adding more const qualifiers,
but I don't really see why "partial const-ification" is confusing.

> The only thing I don't like about this is that it's not apparent that
> the function would close the heap & index relations, so the calling code
> will now look like it's leaking the relation references. Maybe call it
> IndexCloseAndUpdateStats or something like that?

Good point -- I'll make that change.

-Neil

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Magnus Hagander 2004-11-07 11:36:17 Re: [PATCHES] pgxs under Win32 for PL/Java
Previous Message Thomas Hallgren 2004-11-07 10:50:59 Re: pgxs under Win32 for PL/Java