Re: bug in GUC

From: "Thomas Hallgren" <thhal(at)mailblocks(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: bug in GUC
Date: 2004-06-24 14:45:31
Message-ID: cbeplq$2nl6$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers pgsql-patches

Ok, so I'm a newbie. To my defence I'll say that I made an effort to follow
the style previously used in guc.c. The unchecked mallocs I added where not
the first ;-)

So, what you are saying is that there's no need for the functions I
suggested and that a palloc using the TopMemoryContext will guarantee
correct behavior on "out of memory"?

Kind regards,

Thomas Hallgren

"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote in message
news:13534(dot)1088085728(at)sss(dot)pgh(dot)pa(dot)us(dot)(dot)(dot)
> "Thomas Hallgren" <thhal(at)mailblocks(dot)com> writes:
> > Rather than clutter the code with the same ereport over and over again
(I
> > count 12 malloc's in guc.c alone), I'd like something like this:
>
> The larger question is why it contains even one. In general, use of
> malloc in the backend is the mark of a newbie. I'd think palloc in
> TopMemoryContext would be a more suitable approach.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message James Robinson 2004-06-24 15:59:59 Re: [HACKERS] bug in GUC
Previous Message Tom Lane 2004-06-24 14:02:08 Re: bug in GUC

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Cramer 2004-06-24 15:02:04 Re: JDBC prepared statements: actually not server
Previous Message Thomas Hallgren 2004-06-24 14:38:47 Re: warning missing

Browse pgsql-patches by date

  From Date Subject
Next Message James Robinson 2004-06-24 15:59:59 Re: [HACKERS] bug in GUC
Previous Message Tom Lane 2004-06-24 14:32:21 Re: pg_dump --clean w/ <= 7.2 server