diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2003-12-03 09:50:40 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2003-12-03 09:50:40 +0000 |
commit | 5ff0237060f1b93f5efe8e4041bbde2a2f674cbe (patch) | |
tree | 7eb2780a520c46705e1065d50ef30e9c7d58eed4 /epan/tvbuff.h | |
parent | dcd98ae8d334081d0b4e0f4c6902ac128dfeb000 (diff) | |
download | wireshark-5ff0237060f1b93f5efe8e4041bbde2a2f674cbe.tar.gz wireshark-5ff0237060f1b93f5efe8e4041bbde2a2f674cbe.tar.bz2 wireshark-5ff0237060f1b93f5efe8e4041bbde2a2f674cbe.zip |
performance update
replace tvb_raw_offset() which is essentially a simple assignment and which
is called a lot with a macro.
this makes my tethereal testcase 2-3% faster.
svn path=/trunk/; revision=9152
Diffstat (limited to 'epan/tvbuff.h')
-rw-r--r-- | epan/tvbuff.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/epan/tvbuff.h b/epan/tvbuff.h index 2758f136c8..aa5339510a 100644 --- a/epan/tvbuff.h +++ b/epan/tvbuff.h @@ -9,7 +9,7 @@ * the data of a backing tvbuff, or can be a composite of * other tvbuffs. * - * $Id: tvbuff.h,v 1.35 2003/12/02 10:23:18 sahlberg Exp $ + * $Id: tvbuff.h,v 1.36 2003/12/03 09:50:40 sahlberg Exp $ * * Copyright (c) 2000 by Gilbert Ramirez <gram@alumni.rice.edu> * @@ -284,8 +284,11 @@ extern gint tvb_reported_length_remaining(tvbuff_t *tvb, gint offset); Also adjusts the data length. */ extern void tvb_set_reported_length(tvbuff_t*, guint); +extern int offset_from_real_beginning(tvbuff_t *tvb, int counter); + /* Returns the offset from the first byte of real data. */ -extern gint tvb_raw_offset(tvbuff_t*); +#define TVB_RAW_OFFSET(tvb) \ + ((tvb->raw_offset==-1)?(tvb->raw_offset = offset_from_real_beginning(tvb, 0)):tvb->raw_offset) /************** START OF ACCESSORS ****************/ /* All accessors will throw an exception if appropriate */ |