Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-commits: [Wireshark-commits] rev 29445: /trunk/epan/ /trunk/epan/: tvbuff.c tvbuff.h

Date: Sun, 16 Aug 2009 10:53:48 GMT
http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=29445

User: krj
Date: 2009/08/16 03:53 AM

Log:
 Add a new function, tvb_new_subset_remaining(), which is a sligtly optimized version of tvb_new_subset(). The latter can be mapped to the former by tvb_new_subset(tvb, offset, -1 /* backing_length */, -1 /* reported_length */). We can disable some bounds checking because 'backing_length' and 'reported_length' are hardcoded to -1.
 
 The current implementation of tvb_new_subset_remaining() only has the THROW_ON(reported_length < 1) check removed when compared to tvb_new_subset(). So there's room for improvement in this function. We should be able to disable some more (redundant) bounds checking.

Directory: /trunk/epan/
  Changes    Path          Action
  +35 -3     tvbuff.c      Modified
  +4 -0      tvbuff.h      Modified