Re: Replace use malloc() & friend by memory contexts for plperl and pltcl - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Replace use malloc() & friend by memory contexts for plperl and pltcl
Date
Msg-id 15147.1472679001@sss.pgh.pa.us
Whole thread Raw
In response to Replace use malloc() & friend by memory contexts for plperl and pltcl  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: Replace use malloc() & friend by memory contexts for plperl and pltcl  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Michael Paquier <michael.paquier@gmail.com> writes:
> Cleanup $subject has been raised a couple of times, like one year ago here:
> https://www.postgresql.org/message-id/CAB7nPqRxvq+Q66UFzD9wa5UAftYN4WAUADbjXKFrync96kf-VQ@mail.gmail.com
> And more recently here while working on the NULL checks for malloc():
> https://www.postgresql.org/message-id/CAB7nPqR7ozfCqc6C=2+ctCcnuehTZ-vTDQ8MMhY=BQyET0Honw@mail.gmail.com

> Attached are a set of patches to replace those memory system calls by
> proper memory contexts:
> - 0001 does the cleanup work for pltcl
> - 0002 does this cleanup for plperl

I looked at 0001.  It seemed to me that it wasn't that useful to add a
context unless we did something about actually freeing it; otherwise
we're just increasing the amount of memory leaked after a function
redefinition.  However, it proved pretty easy to shoehorn in a refcounting
mechanism like plpgsql has, so I did that and pushed it.

Off to look at 0002 next.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: [PATCH] Reload SSL certificates on SIGHUP
Next
From: Andres Freund
Date:
Subject: Re: _mdfd_getseg can be expensive