From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Improve memory management for PL/Perl functions. |
Date: | 2016-08-31 23:55:07 |
Message-ID: | E1bfFLX-0006u8-0f@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Improve memory management for PL/Perl functions.
Unlike PL/Tcl, PL/Perl at least made an attempt to clean up after itself
when a function gets redefined. But it was still using TopMemoryContext
for the fn_mcxt of argument/result I/O functions, resulting in the
potential for memory leaks depending on what those functions did, and the
retail alloc/free logic was pretty bulky as well. Fix things to use a
per-function memory context like the other PLs now do. Tweak a couple of
places where things were being done in a not-very-safe order (on the
principle that a memory leak is better than leaving global state
inconsistent after an error). Also make some minor cosmetic adjustments,
mostly in field names, to make the code look similar to the way PL/Tcl does
now wherever it's essentially the same logic.
Michael Paquier and Tom Lane
Discussion: <CAB7nPqSOyAsHC6jL24J1B+oK3p=yyNoFU0Vs_B6fd2kdd5g5WQ(at)mail(dot)gmail(dot)com>
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/6f7c0ea32f808a7dad3ec07db7e5fdf6514d2af0
Modified Files
--------------
src/pl/plperl/plperl.c | 237 +++++++++++++++++++++++++------------------------
1 file changed, 122 insertions(+), 115 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2016-09-01 04:57:17 | Re: pgsql: Add putenv support for msvcrt from Visual Studio 2013 |
Previous Message | Tom Lane | 2016-08-31 21:27:16 | pgsql: Improve memory management for PL/Tcl functions. |