Memory allocation abstraction in pgcrypto

Started by Daniel Gustafssonover 5 years ago3 messageshackers
Jump to latest
#1Daniel Gustafsson
daniel@yesql.se

pgcrypto has an abstraction for palloc/pfree via PX_OWN_ALLOC with the
intention to make it easy to swap out for another allocator. There are however
a number of palloc calls that have snuck in over the years, so the abstraction
is leaking a fair bit making it less useful. Since there have been no
complaints that I can see (searching the archives for PX_OWN_ALLOC yields zero
threads, and px_alloc none about this topic) then maybe it's time to remove it
and simplify the code?

The attached removes it in favor of using palloc() et.al directly. Is there
any reason to keep it around still?

cheers ./daniel

Attachments:

0001-Remove-memory-allocation-abstraction-in-pgcrypto.patchapplication/octet-stream; name=0001-Remove-memory-allocation-abstraction-in-pgcrypto.patch; x-unix-mode=0644Download+106-144
#2Michael Paquier
michael@paquier.xyz
In reply to: Daniel Gustafsson (#1)
Re: Memory allocation abstraction in pgcrypto

On Fri, Sep 18, 2020 at 10:00:04PM +0200, Daniel Gustafsson wrote:

The attached removes it in favor of using palloc() et.al directly. Is there
any reason to keep it around still?

I doubt that anybody has been compiling with PX_OWN_ALLOC in the last
years, so let's remove this abstraction. And +1 for your patch.
--
Michael

#3Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#2)
Re: Memory allocation abstraction in pgcrypto

On Wed, Sep 23, 2020 at 04:57:44PM +0900, Michael Paquier wrote:

I doubt that anybody has been compiling with PX_OWN_ALLOC in the last
years, so let's remove this abstraction. And +1 for your patch.

So, I have looked at that this morning again, and applied the thing.
--
Michael