Re: Expand palloc/pg_malloc API
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2022-08-29T14:39:35Z
Lists: pgsql-hackers
On Fri, Aug 12, 2022 at 3:31 AM Peter Eisentraut <peter.eisentraut@enterprisedb.com> wrote: > (Personally, I have always been a bit suspicious about using the name > palloc() without memory context semantics in frontend code, but I guess > this is wide-spread now.) I think it would be a good thing to add memory context support to the frontend. We could just put everything in a single context for starters, and then frontend utilities that wanted to create other contexts could do so. There are difficulties, though. For instance, memory contexts are nodes, and have a NodeTag. And I'm pretty sure we don't want frontend code to know about all the backend node types. My suspicion is that memory context types really shouldn't be node types, but right now, they are. Whether that's the correct view or not, this kind of problem means it's not a simple lift-and-shift to move the memory context code into src/common. Someone would need to spend some time thinking about how to engineer it. -- Robert Haas EDB: http://www.enterprisedb.com
Commits
-
Add repalloc0 and repalloc0_array
- b4b7ce8061d3 16.0 landed
-
Expand palloc/pg_malloc API for more type safety
- 2864f7755611 10.23 landed
- e962235fe1f6 11.18 landed
- 7dd9b469bc56 12.13 landed
- 172882292451 13.9 landed
- b7f37af7c195 14.6 landed
- 7fe55d5e12b6 15.0 landed
- 2016055a92f2 16.0 landed
-
Assorted examples of expanded type-safer palloc/pg_malloc API
- 5015e1e1b58f 16.0 landed