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

PLy_malloc and plperl mallocs

From: Jan Urbański <wulczer(at)wulczer(dot)org>
To: Postgres - Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: PLy_malloc and plperl mallocs
Date: 2010-11-28 00:18:17
Message-ID: 4CF19FC9.60309@wulczer.org (view raw or flat)
Thread:
Lists: pgsql-hackers
I noticed that PL/Python uses a simple wrapper around malloc that does
ereport(FATAL) if malloc returns NULL. I find it a bit harsh, don't we
normally do ERROR if we run out of memory?

And while looking at how PL/Perl does these things I find that one
failed malloc (in compile_plperl_function) throws an ERROR, and the rest
(in plperl_spi_prepare) are simply unguarded...

I guess PL/Python should stop throwing FATAL errors and PL/Perl should
get its own malloc_or_ERROR helper and start using that.

Cheers,
Jan

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2010-11-28 01:09:11
Subject: Re: s/LABEL/VALUE/ for ENUMs
Previous:From: Bruce MomjianDate: 2010-11-27 22:30:11
Subject: Re: What do these terms mean in the SOURCE CODE?

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