pgsql: Attached is a patch that replaces a bunch of places where - Mailing list pgsql-committers

From neilc@postgresql.org (Neil Conway)
Subject pgsql: Attached is a patch that replaces a bunch of places where
Date
Msg-id 20060301065101.81C869DCA22@postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Attached is a patch that replaces a bunch of places where StringInfos
are unnecessarily allocated on the heap rather than the stack. If the
StringInfo doesn't outlive the stack frame in which it is created,
there is no need to allocate it on the heap via makeStringInfo() --
stack allocation is faster.  While it's not a big deal unless the
code is in a critical path, I don't see a reason not to save a few
cycles -- using stack allocation is not less readable.

I also cleaned up a bit of code along the way: moved variable
declarations into a more tightly-enclosing scope where possible,
fixed some pointless copying of strings in dblink, etc.

Modified Files:
--------------
    pgsql/contrib/dblink:
        dblink.c (r1.51 -> r1.52)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/contrib/dblink/dblink.c.diff?r1=1.51&r2=1.52)
    pgsql/contrib/tablefunc:
        tablefunc.c (r1.40 -> r1.41)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/contrib/tablefunc/tablefunc.c.diff?r1=1.40&r2=1.41)
    pgsql/contrib/xml2:
        xpath.c (r1.9 -> r1.10)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/contrib/xml2/xpath.c.diff?r1=1.9&r2=1.10)
    pgsql/src/backend/commands:
        explain.c (r1.144 -> r1.145)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/explain.c.diff?r1=1.144&r2=1.145)
    pgsql/src/backend/utils/adt:
        varlena.c (r1.143 -> r1.144)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/varlena.c.diff?r1=1.143&r2=1.144)

pgsql-committers by date:

Previous
From: neilc@postgresql.org (Neil Conway)
Date:
Subject: pgsql: This patch makes the error message strings throughout the backend
Next
From: Tom Lane
Date:
Subject: Re: pgsql: Allow the syntax CREATE TYPE foo, with no parameters, to permit