cpp-common/bt2c: change some `static inline` functions to just `inline`
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 21 Feb 2024 18:36:05 +0000 (13:36 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 26 Mar 2024 18:56:36 +0000 (14:56 -0400)
commit485083ae732b1c6ecfd2882d7ef9745e97768e19
treea7ce8d72dca1b319bbda0d619f4455a1d9046f08
parenta11f4e1001b9dcf20e4ce62d6c945a4869b0b317
cpp-common/bt2c: change some `static inline` functions to just `inline`

I believe that using `inline` for functions in header is preferable to
`static inline`.  With `static inline`, the symbols resulting from the
functions are internal to each translation unit.  We may end up with
multiple copies of the same function in the final executable.  With
`inline`, the linker de-duplicates them.  This is better for code size
and cache and all that.  It may not be relevant for these functions, but
it would be good to set the precendent for the functions we will add in
the future.

The caveat with that is that all copies a function must be identical
(ODR), but I don't think we have a problem with that.

Change-Id: I62eeacf4e8326d70cb94aec33d6684453e1b8912
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11843
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
src/cpp-common/bt2c/c-string-view.hpp
src/cpp-common/bt2c/endian.hpp
This page took 0.024862 seconds and 4 git commands to generate.