Re: Last call for comments: fmgr rewrite [LONG]

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Chris Bitmead <chrisb(at)nimrod(dot)itg(dot)telstra(dot)com(dot)au>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Last call for comments: fmgr rewrite [LONG]
Date: 2000-05-22 04:46:18
Message-ID: 12694.958970778@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Chris Bitmead <chrisb(at)nimrod(dot)itg(dot)telstra(dot)com(dot)au> writes:
> I was thinking of something more along the lines of a Corba idl code
> generator, only simpler. Maybe as simple as a file like:

> int4plus: INT4, INT4
> int4minus: INT4, INT4
> etc...

> that gets generated into some stubs that call the real code...

> Datum
> int4pl_stub(PG_FUNCTION_ARGS)
> {
> int32 arg1 = PG_GETARG_INT32(0);
> int32 arg2 = PG_GETARG_INT32(1);

> return PG_RETURN_INT32(int4pl(arg1, arg2));
> }

OK ... but I don't think we want to leave a useless extra level of
function call in the code forever. What I'm starting to visualize
is a simple editing script that adds the above decoration to an existing
function definition, and then you go back and do any necessary cleanup
by hand. There is a lot of cruft that we should be able to rip out of
the existing code (checks for NULL arguments that are no longer needed
if the function is declared strict, manipulation of pass-by-ref args
and results for float4/float8/int8 datatypes, etc etc) so a hand
editing pass will surely be needed. But maybe we could mechanize
creation of the basic GETARG/RETURN decorations...

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-05-22 05:15:15 Re: Last call for comments: fmgr rewrite [LONG]
Previous Message Chris Bitmead 2000-05-22 04:43:18 Re: Last call for comments: fmgr rewrite [LONG]