> Now, if I can get an SMTP decoder done with my new per-packet state info,
> can I get it in in time?
In time for what?
> We will also have to ensure that this state info is discarded when a trace
> is discarded.
>
> I suspect that this will need to be done by each protocol that registers
> state for a packet also registering a routine that cleans up that state info?
>
> We could then call a state release routine when each frame data structure
> is released, or we could release the GLIB chunks in the appropriate order.
>
> Which is better?
If the dissectors use the GMemChunk stuff to allocate their per-frame
data (which, I think, saves memory, as the "malloc()" overhead is
amortized over all the data structures in the chunk), releasing them all
at once would, I suspect, be faster.
The dissector could then just register an init routine, and free up the
per-frame data structures in that routine.
However, if the per-frame data structures allocated by a dissector
aren't all identical, so that it has to allocate them with "g_malloc()",
they'd either have to be tied together with pointers, so that they can
all be freed by a loop, or a release routine would have to be called as
each frame data structure is released.