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

Re: PLy_malloc and plperl mallocs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jan Urbański <wulczer(at)wulczer(dot)org>
Cc: Postgres - Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PLy_malloc and plperl mallocs
Date: 2010-11-28 03:28:10
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
=?UTF-8?B?SmFuIFVyYmHFhHNraQ==?= <wulczer(at)wulczer(dot)org> writes:
> 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.

The real question is why they're not using palloc instead.

			regards, tom lane

In response to


pgsql-hackers by date

Next:From: Bruce MomjianDate: 2010-11-28 04:18:58
Subject: Re: profiling connection overhead
Previous:From: Robert HaasDate: 2010-11-28 03:22:03
Subject: Re: Report: Linux huge pages with Postgres

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