Wireshark mailing list archives
Re: [PATCH] Re: Freeing memory of se_alloc'ated object
From: Jeff Morriss <jeff.morriss.ws () gmail com>
Date: Mon, 02 May 2011 15:38:32 -0400
Max wrote:
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.
Would it be simpler (and more generic) to have a "cleanup"/EOF routine similar to the init mechanism but called as soon as we reach (the final) EOF (before the se memory is freed)?
It could also be used to indicate to things like TCP desegmentation that we've reached EOF so TCP could attempt to desegment things marked DESEGMENT_UNTIL_FIN even though we haven't seen a FIN (see bug 3785). Any memory held hoping for more packets (e.g., the last fragments for reassembly) could be freed at the end of the capture instead of waiting for the file to be closed.
___________________________________________________________________________ Sent via: Wireshark-dev mailing list <wireshark-dev () wireshark org> Archives: http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-request () wireshark org?subject=unsubscribe
Current thread:
- Freeing memory of se_alloc'ated object Max (May 01)
- Re: Freeing memory of se_alloc'ated object Guy Harris (May 01)
- Re: Freeing memory of se_alloc'ated object Max (May 01)
- Re: Freeing memory of se_alloc'ated object Guy Harris (May 01)
- [PATCH] Re: Freeing memory of se_alloc'ated object Max (May 01)
- Re: [PATCH] Re: Freeing memory of se_alloc'ated object darkjames-ws (May 02)
- Re: [PATCH] Re: Freeing memory of se_alloc'ated object Max (May 02)
- Re: [PATCH] Re: Freeing memory of se_alloc'ated object Jakub Zawadzki (May 03)
- Re: Freeing memory of se_alloc'ated object Max (May 01)
- Re: [PATCH] Re: Freeing memory of se_alloc'ated object Jeff Morriss (May 02)
- Re: [PATCH] Re: Freeing memory of se_alloc'ated object Guy Harris (May 02)
- Re: [PATCH] Re: Freeing memory of se_alloc'ated object Max (May 02)
- Re: [PATCH] Re: Freeing memory of se_alloc'ated object ronnie sahlberg (May 02)
- Re: [PATCH] Re: Freeing memory of se_alloc'ated object Max Dmitrichenko (May 02)
- Re: [PATCH] Re: Freeing memory of se_alloc'ated object Stephen Fisher (May 03)
- Re: Freeing memory of se_alloc'ated object Guy Harris (May 01)
- Re: [PATCH] Re: Freeing memory of se_alloc'ated object Jeff Morriss (May 03)
- Re: [PATCH] Re: Freeing memory of se_alloc'ated object Max (May 02)