X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4D54CD1C50B for ; Thu, 24 Jun 2004 12:13:26 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 17467-07 for ; Thu, 24 Jun 2004 15:13:21 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 5D968D1C4D4 for ; Thu, 24 Jun 2004 12:13:21 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i5OFDKQC000781 for ; Thu, 24 Jun 2004 15:13:20 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i5OEnUgW089767 for pgsql-hackers@postgresql.org; Thu, 24 Jun 2004 14:49:30 GMT From: "Thomas Hallgren" X-Newsgroups: comp.databases.postgresql.hackers Subject: Re: bug in GUC Date: Thu, 24 Jun 2004 16:45:31 +0200 Organization: Hub.Org Networking Services Lines: 31 Message-ID: References: <20040624052712.GA7158@dcc.uchile.cl> <13534.1088085728@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 To: pgsql-hackers@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/863 X-Sequence-Number: 55413 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" wrote in message news:13534.1088085728@sss.pgh.pa.us... > "Thomas Hallgren" 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 >