2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Remove use of the inline keyword used as suggestion to compiler

Historically, the inline keyword was a strong suggestion to the compiler
that it should inline the function marked inline.  As compilers became
better at optimising, this functionality has receded, and using inline
as a suggestion to inline a function is obsolete.  The compiler will
happily ignore it and inline something else entirely if it finds that's
a better optimisation.

Therefore, remove all the occurences of the inline keyword with static
functions inside single compilation unit and leave the decision whether
to inline a function or not entirely on the compiler

NOTE: We keep the usage the inline keyword when the purpose is to change
the linkage behaviour.
This commit is contained in:
Ondřej Surý
2021-10-11 13:43:12 +02:00
committed by Ondřej Surý
parent 04d0b70ba2
commit 20f0936cf2
151 changed files with 1485 additions and 1488 deletions

View File

@@ -207,7 +207,7 @@ static void
print_active(isc_mem_t *ctx, FILE *out);
#endif /* ISC_MEM_TRACKLINES */
static inline size_t
static size_t
increment_malloced(isc_mem_t *ctx, size_t size) {
size_t malloced = atomic_fetch_add_relaxed(&ctx->malloced, size) + size;
size_t maxmalloced = atomic_load_relaxed(&ctx->maxmalloced);
@@ -220,7 +220,7 @@ increment_malloced(isc_mem_t *ctx, size_t size) {
return (malloced);
}
static inline size_t
static size_t
decrement_malloced(isc_mem_t *ctx, size_t size) {
size_t malloced = atomic_fetch_sub_relaxed(&ctx->malloced, size) - size;
@@ -335,7 +335,7 @@ unlock:
/*!
* Perform a malloc, doing memory filling and overrun detection as necessary.
*/
static inline void *
static void *
mem_get(isc_mem_t *ctx, size_t size, int flags) {
char *ret = NULL;
@@ -355,7 +355,7 @@ mem_get(isc_mem_t *ctx, size_t size, int flags) {
* Perform a free, doing memory filling and overrun detection as necessary.
*/
/* coverity[+free : arg-1] */
static inline void
static void
mem_put(isc_mem_t *ctx, void *mem, size_t size, int flags) {
ADJUST_ZERO_ALLOCATION_SIZE(size);
@@ -365,7 +365,7 @@ mem_put(isc_mem_t *ctx, void *mem, size_t size, int flags) {
sdallocx(mem, size, flags);
}
static inline void *
static void *
mem_realloc(isc_mem_t *ctx, void *old_ptr, size_t old_size, size_t new_size,
int flags) {
void *new_ptr = NULL;
@@ -395,7 +395,7 @@ mem_realloc(isc_mem_t *ctx, void *old_ptr, size_t old_size, size_t new_size,
/*!
* Update internal counters after a memory get.
*/
static inline void
static void
mem_getstats(isc_mem_t *ctx, size_t size) {
struct stats *stats = stats_bucket(ctx, size);
@@ -411,7 +411,7 @@ mem_getstats(isc_mem_t *ctx, size_t size) {
/*!
* Update internal counters after a memory put.
*/
static inline void
static void
mem_putstats(isc_mem_t *ctx, void *ptr, size_t size) {
struct stats *stats = stats_bucket(ctx, size);
@@ -690,7 +690,7 @@ isc__mem_destroy(isc_mem_t **ctxp FLARG) {
} \
}
static inline bool
static bool
hi_water(isc_mem_t *ctx) {
size_t inuse;
size_t maxinuse;
@@ -726,7 +726,7 @@ hi_water(isc_mem_t *ctx) {
return (true);
}
static inline bool
static bool
lo_water(isc_mem_t *ctx) {
size_t inuse;
size_t lowater = atomic_load_relaxed(&ctx->lo_water);