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