This causes them to be freed on shutdown, cleaning up ~800KB of "reachable"
memory according to valgrind. The fact that we even need to construct these as
value_strings is questionable IMHO, but that's a problem for a later date.
Switch epan_scope to the BLOCK allocator now that we're using it for so much
more, this gives a small but measurable increase in startup time.
Change-Id: I187460b769e28da3c6629abac1d9196727ae7dde
Reviewed-on: https://code.wireshark.org/review/9483
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
gbl_resolv_flags.transport_name = TRUE;
for (i = 0, j = 0; i <= 65535; i++) {
- const char *serv = tcp_port_to_display(NULL, i);
+ const char *serv = tcp_port_to_display(wmem_epan_scope(), i);
if (serv) {
value_string *p = &tcp_ports[j++];
gbl_resolv_flags.transport_name = TRUE;
for (i = 0, j = 0; i <= 65535; i++) {
- const char *serv = udp_port_to_display(NULL, i);
+ const char *serv = udp_port_to_display(wmem_epan_scope(), i);
if (serv) {
value_string *p = &udp_ports[j++];
packet_scope = wmem_allocator_new(WMEM_ALLOCATOR_BLOCK_FAST);
file_scope = wmem_allocator_new(WMEM_ALLOCATOR_BLOCK);
- epan_scope = wmem_allocator_new(WMEM_ALLOCATOR_SIMPLE);
+ epan_scope = wmem_allocator_new(WMEM_ALLOCATOR_BLOCK);
/* Scopes are initialized to TRUE by default on creation */
packet_scope->in_scope = FALSE;