Skip to content

tweak inlining

Vladimír Čunát requested to merge tweak-inlining into master

I used -Winline (optimizing, gcc 11 - hmm, maybe typo and it was 12?) to gather warnings about cases that were considered too expensive for inlining. Some of these probably used not to happen when we were dropping assertions during preprocessing in -DNDEBUG builds. This commit mainly improves size of the compiled binary by several KiB.

  • queue_head_impl(): optionally (un)inline; not big but in warnings
  • queue_pop_impl(): uninline; too complex for my today's eyes
  • kr_rand_bytes(): optionally (un)inline The inlining potential there comes from calling with a constant.
  • kr_straddr(): uninline. It's never been meant for hot code, and this gives us large savings due to deduplicating the static array.
  • For some I couldn't see a good resolution due to restrictions in C.

C hint: static inline is probably well known; the other inline combination is well explained at: https://stackoverflow.com/a/6312813/587396

Edited by Vladimír Čunát

Merge request reports