Skip site navigation (1) Skip section navigation (2)

Re: fix a bogus line in dynahash.c

From: Neil Conway <neilc(at)samurai(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu>,pgsql-patches(at)postgresql(dot)org
Subject: Re: fix a bogus line in dynahash.c
Date: 2005-05-25 03:07:52
Message-ID: 4293EC08.5080304@samurai.com (view raw or flat)
Thread:
Lists: pgsql-patches
Tom Lane wrote:
> That test is a no-op in the case where hashp->alloc in fact points to
> palloc.  But it doesn't always point there --- see shmem_alloc.

Perhaps it would be a net win to change ShmemAlloc() to elog(ERROR) on 
out-of-memory? A fair few of the ShmemAlloc() call sites don't bother to 
check the return value anyway, and a few more just elog(ERROR). For the 
few cases when we do need to do some cleanup, PG_TRY() could be used, or 
we could just provide a variant of ShmemAlloc() that returns NULL on OOM 
and could be used when error recovery is required.

-Neil

In response to

Responses

pgsql-patches by date

Next:From: Tom LaneDate: 2005-05-25 03:08:36
Subject: Re: [PATCH] pg_autovacuum commandline password hiding.
Previous:From: Qingqing ZhouDate: 2005-05-25 03:06:19
Subject: Re: fix a bogus line in dynahash.c

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group