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

From: neilc(at)postgresql(dot)org (Neil Conway)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Attached is a patch that replaces a bunch of places where
Date: 2006-03-01 06:51:01
Message-ID: 20060301065101.81C869DCA22@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2006-03-01 06:52:51 Re: pgsql: Allow the syntax CREATE TYPE foo, with no parameters, to permit
Previous Message Neil Conway 2006-03-01 06:30:32 pgsql: This patch makes the error message strings throughout the backend