]> 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)
committerFrancois-Xavier Le Bail <[email protected]>
Fri, 13 Oct 2023 09:47:14 +0000 (11:47 +0200)
commit59b65340e619f3d898ff2ca5b3a8b5d5df894d73
treec674ebf45e2e4bad7d29684b3932aa09f635d456
parent66ae1e467427d4a19854e8cddf77788ff6ad9da3
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.

(cherry picked from commit 5faefb7542821b54193414fe03d7650c25d05380)
netdissect.c
netdissect.h