Re: bug in GUC - Mailing list pgsql-hackers

From Thomas Hallgren
Subject Re: bug in GUC
Date
Msg-id cbeplq$2nl6$1@news.hub.org
Whole thread Raw
In response to bug in GUC  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Responses Re: bug in GUC
Re: bug in GUC
List pgsql-hackers
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@sss.pgh.pa.us> wrote in message
news:13534.1088085728@sss.pgh.pa.us...
> "Thomas Hallgren" <thhal@mailblocks.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
>



pgsql-hackers by date:

Previous
From: James Robinson
Date:
Subject: Re: PREPARE and transactions
Next
From: "Cyril VELTER"
Date:
Subject: [Re] Re: PREPARE and transactions