Re: [PATCH 3/7] merge-ort: add pool_alloc, pool_calloc, and pool_strndup wrappers
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Jul 26, 2021, 14:36 UTC
- Message-ID
- <bc24ea9c-178c-bcc9-2097-2271df93ae76@gmail.com>
- In-Reply-To
- <e30b8c8fea110b2475d00a4b37eb62a4883999c4.1627044897.git.gitgitgadget@gmail.com>
On 7/23/2021 8:54 AM, Elijah Newren via GitGitGadget wrote:
Show 8 quoted lines
> From: Elijah Newren <newren@gmail.com> > > We need functions which will either call > xmalloc, xcalloc, xstrndup > or > mem_pool_alloc, mem_pool_calloc, mem_pool_strndup > depending on whether we have a non-NULL memory pool. Add these > functions; the next commit will make use of these.
I briefly considered that this should just be the way the mem_pool_* methods work. It does rely on the caller knowing to free() the allocated memory when their pool is NULL, so perhaps such a universal change might be too much. What do you think?
Thanks, -Stolee