Re: Possible bug in plpgsql/src/gram.y

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Possible bug in plpgsql/src/gram.y
Date: 2001-07-12 03:50:26
Message-ID: 200107120350.f6C3oQo20329@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Also, can someone tell my why we use malloc in plpgsql?
>
> Plain palloc() won't do because the compiled tree for the function needs
> to outlive the current query. However, malloc() is not cool. Really,
> these structures ought to be built in a memory context created specially
> for each function --- then it'd be possible to reclaim the memory if the
> function is deleted or we realize we need to invalidate its compiled
> tree.
>
> I've had this in mind to do for awhile, but haven't gotten to it.
> Do you want to put it on TODO?

Done:

* Change PL/PgSQL to use palloc() instead of malloc()

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message spshealy 2001-07-12 04:40:55 SIGCHLD handler in Postgres C function.
Previous Message Bruce Momjian 2001-07-12 03:48:42 Re: [GENERAL] Re: Debian's PostgreSQL packages