Wireshark-dev: Re: [Wireshark-dev] [Wireshark-commits] rev 46320: /trunk/epan/dissectors/ /trun

From: Evan Huus <eapache@xxxxxxxxx>
Date: Sun, 2 Dec 2012 12:06:30 -0500
On Sun, Dec 2, 2012 at 10:49 AM, Jakub Zawadzki <darkjames-ws@xxxxxxxxxxxx> wrote:
On Sun, Dec 02, 2012 at 09:28:24AM -0500, Evan Huus wrote:
> I'm starting to think we tightened the scope of ep memory too much. I do
> think that freeing it at the beginning of epan_dissect_run was wrong, but
> I'm starting to wonder if the right place for it isn't in epan_dissect_run
> at all (beginning or end) but is in epan_dissect_cleanup instead. As a
> bonus I believe this may let us get rid of the epan_dissect_run_with_taps
> function?

You've already proposed it once, in my opinion in some scenarios it won't work,
please read my reply: http://www.wireshark.org/lists/wireshark-dev/201210/msg00198.html

Anyway, some memory pool only for single edt initalized in epan_dissect_init(),
and later freed in epan_dissect_cleanup() will work.

Done in revision 46331. Any other cases where memory needs to stick around as long as the edt struct can use wmem with pinfo->pool.
 
Also I proposed other (simpler?) idea: http://www.wireshark.org/lists/wireshark-dev/201210/msg00204.html
But we right now have wmem_ so it'd be better to use wmem interface.

In the simple case wmem doesn't do anything more than you described there, it just abstracts that pattern away. (It can do more in the complicated cases of course).

Cheers,
Evan