>> In this situation it would
>> be perfect if se_alloc() engine could call a callback with a user
>> supplied argument before it starts to deallocate anything.
>
> The init mechanism was created before the ephemeral memory stuff even existed, and has never been updated.
>
> Some better mechanism, such as the one you suggest, would probably be a good idea.
I've developed a patch which implements such a mechanism and would
like it to be committed to the trunk.
Briefly: it costs one additional pointer per each memory chunk
allocated. Plus it costs thee additional pointers per allocation, if
allocation is made from pool in chunk mode when destructor is used,
otherwise it costs nothing. Callback is supplied as a parameter to
allocation function.
I would gladly read you comments, critics and suggestions regarding this patch.
--
Max
Attachment:
wireshark-emem-dtor.patch
Description: Binary data