Re: Small xlog.c cleanup - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: Small xlog.c cleanup
Date
Msg-id 200102272055.PAA06622@candle.pha.pa.us
Whole thread Raw
In response to Re: Small xlog.c cleanup  (The Hermit Hacker <scrappy@hub.org>)
List pgsql-patches
> On Tue, 27 Feb 2001, Tom Lane wrote:
>
> > The Hermit Hacker <scrappy@hub.org> writes:
> > > He's moved the "static globals" from around line 286 of
> > > src/backend/access/transam/xlog.c:
> > > to be static locals inside of function ReadRecord around line 1216 in the
> > > same file:
> >
> > This is not usual coding practice in Postgres, so far as I've noticed.
> >
> > I prefer to avoid static locals because the fact that they *are* static
> > is easily missed.  In particular it's way too easy to misread the
> > initialization as something that happens on every entry to the function,
> > rather than only once.  So my opinion is that this change is bad style.
>
> Oops, don't take my response to Bruce as validation, only explanation of
> what he was accomplishing, which Bruce appeared to indicate he didn't
> understand ...

Thanks.  I was looking for 'static/no static' but now replace we was
moving the defines, which makes them behave differently.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

pgsql-patches by date:

Previous
From: The Hermit Hacker
Date:
Subject: Re: Small xlog.c cleanup
Next
From: Matthew Kirkwood
Date:
Subject: Re: Small xlog.c cleanup