[PATCH 08/18] Removed nxt_always_inline from nxt_array_remove_last().

Alejandro Colomar alx.manpages at gmail.com
Thu Jun 2 18:05:02 UTC 2022


We shouldn't be forcing the inline in nxt_slow_path.

Since we're changing from an nxt_always_inline to a C99 inline
function, we now need to emit an extern function, which will be
used when the function is not inlined.

See the usage:

$ grep -rnB1 nxt_array_remove_last
src/nxt_cert.c-896-        if (nxt_slow_path(ret != NXT_OK)) {
src/nxt_cert.c:897:            nxt_array_remove_last(certs);
--
src/nxt_array.h-52-inline void *
src/nxt_array.h:53:nxt_array_remove_last(nxt_array_t *array)
---
 src/nxt_array.c | 3 +++
 src/nxt_array.h | 1 -
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/nxt_array.c b/src/nxt_array.c
index 1e13c22..a05c05b 100644
--- a/src/nxt_array.c
+++ b/src/nxt_array.c
@@ -148,3 +148,6 @@ nxt_array_copy(nxt_mp_t *mp, nxt_array_t *dst, nxt_array_t *src)
 
     return dst;
 }
+
+
+extern void *nxt_array_remove_last(nxt_array_t *array);
diff --git a/src/nxt_array.h b/src/nxt_array.h
index 548548f..c71927b 100644
--- a/src/nxt_array.h
+++ b/src/nxt_array.h
@@ -48,7 +48,6 @@ NXT_EXPORT nxt_array_t *nxt_array_copy(nxt_mp_t *mp, nxt_array_t *dst,
     ((array)->nelts == 0)
 
 
-nxt_always_inline
 inline void *
 nxt_array_remove_last(nxt_array_t *array)
 {
-- 
2.36.1



More information about the unit mailing list