Re: [COMMITTERS] pgsql: Add new function dsa_allocate0.
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Michael Paquier <michael.paquier@gmail.com>,
Thomas Munro <thomas.munro@enterprisedb.com>,
"pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2017-02-17T16:41:13Z
Lists: pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes: > I'm thinking we should change this to look more like the > MemoryContextAlloc interface. Let's have DSA_ALLOC_HUGE, > DSA_ALLOC_NO_OOM, and DSA_ALLOC_ZERO, just like the corresponding > MCXT_* flags, and a function dsa_allocate_extended() that takes a > flags argument. Then, dsa_allocate(x,y) can be a macro for > dsa_allocate_extended(x,y,0) and dsa_allocate0(x,y) can be a macro for > dsa_allocate_extended(x,y,DSA_ALLOC_ZERO). What this goof on my (and > Dilip's) part illustrates to me is that having this interface behave > significantly differently from the MemoryContextAlloc interface is > going to cause mistakes. +1 regards, tom lane
Commits
-
Make dsa_allocate interface more like MemoryContextAlloc.
- 16be2fd10019 10.0 landed
-
Add new function dsa_allocate0.
- 9acb85597f12 10.0 cited