diff options
author | Evan Huus <eapache@gmail.com> | 2014-04-20 17:27:18 -0400 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2014-04-21 15:37:06 +0000 |
commit | d47ae54806201a868b7e012e52d1bab19b78ae06 (patch) | |
tree | a5f6bd1a761ee2c1545eeae3fa8f0e934315caec /epan/proto.h | |
parent | 5983cda769fa6615dda5fc7b8f87819d40f0a8d5 (diff) |
Replace linked list of proto fields with array
This is substantially more memory-efficient, shaving another ~1.5MB off our base
usage. It also lets us remove the annoying extra "last_field" pointer and
simplify proto_register_field_common(). It also accidentally fixed what may
have been a memory leak in proto_unregister_field().
It unfortunately complicates proto_get_next_protocol_field() to require
refetching the protocol each time, but that is itself just an array-lookup under
the covers (and isn't much used), so I don't expect the performance hit to be
noticable.
Change-Id: I8e1006b2326d6563fc3b710b827cc99b54440df1
Reviewed-on: https://code.wireshark.org/review/1225
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'epan/proto.h')
-rw-r--r-- | epan/proto.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/proto.h b/epan/proto.h index eac413478a..f3f34995d3 100644 --- a/epan/proto.h +++ b/epan/proto.h @@ -1900,8 +1900,8 @@ extern gint proto_registrar_get_length(const int n); WS_DLL_PUBLIC int proto_get_first_protocol(void **cookie); WS_DLL_PUBLIC int proto_get_data_protocol(void *cookie); WS_DLL_PUBLIC int proto_get_next_protocol(void **cookie); -WS_DLL_PUBLIC header_field_info *proto_get_first_protocol_field(const int proto_id, void **cookle); -WS_DLL_PUBLIC header_field_info *proto_get_next_protocol_field(void **cookle); +WS_DLL_PUBLIC header_field_info *proto_get_first_protocol_field(const int proto_id, void **cookie); +WS_DLL_PUBLIC header_field_info *proto_get_next_protocol_field(const int proto_id, void **cookie); /** Given a protocol's filter_name. @param filter_name the filter name to search for |