Re: GiST patches for 7.2 (please apply)
От | Tom Lane |
---|---|
Тема | Re: GiST patches for 7.2 (please apply) |
Дата | |
Msg-id | 20335.998505878@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | GiST patches for 7.2 (please apply) (Oleg Bartunov <oleg@sai.msu.su>) |
Список | pgsql-hackers |
Oh, one other comment --- the rtree_gist code had a bunch of functions declared like GISTENTRY * gbox_compress(PG_FUNCTION_ARGS); BOX *gbox_union(PG_FUNCTION_ARGS); GIST_SPLITVEC * gbox_picksplit(PG_FUNCTION_ARGS); bool gbox_consistent(PG_FUNCTION_ARGS); float * gbox_penalty(PG_FUNCTION_ARGS); bool * gbox_same(PG_FUNCTION_ARGS); This is not portable. The declaration of any V1-style fmgr-callable function must be exactly Datum foo(PG_FUNCTION_ARGS); no more and no less. You can't shortcut by assuming that pointers are the same size as Datum, or that bool is the same size as Datum, or that the generated machine code will be the same anyway. (There are machines that have different register conventions for returning pointers and integers, even though they're the same size.) If you're going to put up with the notational cruft of the V1 calling convention for arguments, don't blow the portability advantages by not doing it for results too. I fixed this in rtree_gist.c, but did not look to see if similar problems exist elsewhere. regards, tom lane
В списке pgsql-hackers по дате отправления: