]> The Tcpdump Group git mirrors - tcpdump/commit
Make nd_trunc_longjmp() not static inline.
authorGuy Harris <[email protected]>
Sat, 5 Aug 2023 20:28:53 +0000 (13:28 -0700)
committerGuy Harris <[email protected]>
Sun, 6 Aug 2023 01:26:53 +0000 (18:26 -0700)
commit5faefb7542821b54193414fe03d7650c25d05380
tree2a1d680ce68dbc8dc67f9242bbeff20fc13e83af
parent4da3308f277b7cb520a0edf43b2cca2bc0ed2e29
Make nd_trunc_longjmp() not static inline.

It should rarely be called (if it's called, either the packet was cut
short by snapshot-based slicing or it's malformed, or the dissector has
a bug), so inlining it doesn't help much, and, as it calls longjmp(),
which often expands to a call to __builtin_longjmp(), GCC won't inline
it anyway (see "An Inline Function is As Fast As a Macro" in the GCC
documentation), and Apple clang version 14.0.3 (clang-1403.0.22.14.1),
at least, doesn't inline it, either, so you get a bunch of inlined
definitions of it throughout the generated code.

Just make it a regular routine.
netdissect.c
netdissect.h