pgsql: We no longer need to palloc the VacuumStmt node; keeping it on

Started by Nonamealmost 19 years ago3 messages
#1Noname
alvherre@postgresql.org

Log Message:
-----------
We no longer need to palloc the VacuumStmt node; keeping it on the stack is
simpler.

Modified Files:
--------------
pgsql/src/backend/postmaster:
autovacuum.c (r1.34 -> r1.35)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/postmaster/autovacuum.c.diff?r1=1.34&r2=1.35)

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Noname (#1)
Re: [COMMITTERS] pgsql: We no longer need to palloc the VacuumStmt node; keeping it on

alvherre@postgresql.org (Alvaro Herrera) writes:

We no longer need to palloc the VacuumStmt node; keeping it on the stack is
simpler.

If you're going to do that, you should at least set the nodeTag so that
the struct appears valid to onlookers. A memset wouldn't be out of
place either to make sure that any uninitialized fields behave sanely.

regards, tom lane

#3Alvaro Herrera
alvherre@commandprompt.com
In reply to: Tom Lane (#2)
Re: [COMMITTERS] pgsql: We no longer need to palloc the VacuumStmt node; keeping it on

Tom Lane wrote:

alvherre@postgresql.org (Alvaro Herrera) writes:

We no longer need to palloc the VacuumStmt node; keeping it on the stack is
simpler.

If you're going to do that, you should at least set the nodeTag so that
the struct appears valid to onlookers. A memset wouldn't be out of
place either to make sure that any uninitialized fields behave sanely.

Done, thanks.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support