Обсуждение: pgsql: Attached is a patch that replaces a bunch of places where

Поиск
Список
Период
Сортировка

pgsql: Attached is a patch that replaces a bunch of places where

От
neilc@postgresql.org (Neil Conway)
Дата:
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)