On 4/22/24 4:07 PM, Graham Leggett via dev wrote:
> On 22 Apr 2024, at 14:05, Ruediger Pluem <rpl...@apache.org> wrote:
>
>>>> Now the caller needs to allocate memory even if it is not interested in
>>>> the error or if there is no error at all.
>>>> Wouldn't it be better to add an apu_err_t **err instead (which can be
>>>> NULL) and in case of an error allocate an
>>>> apu_err_t from pool and fill it and return it in **err (provided it was
>>>> not NULL).
>>>
>>> I originally used this pattern and found it overkill - what I do now is
>>> allocate a app_err_t on the stack and immediately
>>> abandon it.
>>
>> Did you commit this?
>
> Updated in http://svn.apache.org/viewvc?rev=1917271&view=rev
But I don't see where you allocate the structure on the stack on the caller
side for apr_crypto and apr_dbm and only copy it to a
pool based alloc in case of an error and that we pass NULL in case of apr_dbd
where we don't process it.
Currently we allocate memory for an apu_err_t struct that we don't need in most
cases as it only matters in case of an error
which I hope is not the typical code path.
Regards
Rüdiger