Re: datum passed to macro which expects a pointer

Поиск
Список
Период
Сортировка
От Gavin Sherry
Тема Re: datum passed to macro which expects a pointer
Дата
Msg-id 20080413013524.GJ26250@europa.idg.com.au
обсуждение исходный текст
Ответ на Re: datum passed to macro which expects a pointer  (Gregory Stark <stark@enterprisedb.com>)
Список pgsql-patches
On Sun, Apr 13, 2008 at 01:42:02AM +0100, Gregory Stark wrote:
> "Gavin Sherry" <swm@alcove.com.au> writes:
>
> > On Sat, Apr 12, 2008 at 07:07:48PM -0400, Tom Lane wrote:
> >> Gavin Sherry <swm@alcove.com.au> writes:
> >> > I wish. It was actually thrown up when we (Greenplum) changed the macros
> >> > to be inline functions as part of changing Datum to be 8 bytes.
> >>
> >> Hmmm ... Datum has been 8 bytes for many years, on 64-bit machines.
> >> What is it you're trying to accomplish by making it wider on 32-bitters?
> >
> > I miss stated there. This was actually about making key 64 bit types
> > pass by value instead of pass by reference.
>
> There was a patch to do this posted recently here as well.
>
> http://archives.postgresql.org/pgsql-patches/2008-03/msg00335.php
>
> Hm. I suppose it's true that you could make Datum 64-bit even on 32-bit
> machines and make int8 and float8 pass-by-value. Seems unlikely to be a net
> win though.

A very quick scan showed me that one bet is missed in this patch which
we learned about the hard way: write_auth_file() assumes timestamptz is
pass by reference.

I'm also not sure if endianness is completely covered in the patch but
it looks fairly accurate. I think PointerGetDatum() may need the union
trick (it's late where I am).

There were other places in the code which were assuming Datums were
equivalent to pointers. I'll dig them up.

Also, it means we can clean up parts of numeric.c which special case
calls from aggregates.

Seems like a pretty clean patch though.

Thanks,

Gavin

В списке pgsql-patches по дате отправления:

Предыдущее
От: Gregory Stark
Дата:
Сообщение: Re: datum passed to macro which expects a pointer
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [PATCH] sh: Add support Renesas SuperH