Wireshark-dev: Re: [Wireshark-dev] [Wireshark-commits] rev 35393: /trunk/epan/dissectors/ /trun
Thanks, I do believe that this is a special case - I wouldn't want to use tvb_get_ptr() anywhere else.
Regards,
Martin
On Thu, Jan 6, 2011 at 3:58 PM, Jeff Morriss
<jeff.morriss.ws@gmail.com> wrote:
Hi Martin,
Yeah, the code looked safe, I've just been on a mission to reduce the usage of tvb_get_ptr() (which I'd love to put in the category of "do not use!"--the only problem there being that it's used all over the place). It did occur to me later that it might be slower; I'll revert the change in a bit.
Regards,
-Jeff
Martin Mathieson wrote:
Jeff,
I made the change to use tvb_get_ptr() because a profile showed that getting the strings each time was quite slow.
The reason I thought this is safe is that this protocol is really a header written out by the corresponding wiretap module, so it should be well-formed (if the file being read isn't well-formed that will be rejected by the wiretap module).
I can't remember how much slower it was, but it gets done several times for each frame read from the file.
Best regards,
Martin
<mailto:wireshark-commits@xxxxxxxxxxxxx>>
------------------------------------------------------------------------
___________________________________________________________________________
Sent via: Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives: http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe
___________________________________________________________________________
Sent via: Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives: http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe