Skip to content

static-ify a bunch of const locals.

dariusd0 requested to merge dariusd0/wireshark:const into master

The compiler will emit code to initialize "const" local variables at scope entry. If the initializer is compile-time constant, making them "static" will allow that local variable to be instead statically initialized and placed in a read-only data segment, with there no longer being any need for code to initialize them. This has benefits in reducing program text size and increasing performance through the removal of initialization code.

The arbitrary collection of "const" locals in this change amount to 3.8 kBytes of eliminated initialization code for an increase of 1.8 kBytes of read-only data.

Merge request reports