From d663f4894124307ef9b712222ef19085f79cb460 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sun, 11 Aug 2013 16:29:27 -0400 Subject: [PATCH] Introduce URCU_INLINE_SMALL_FUNCTIONS Reviewed-by: Paul E. McKenney Signed-off-by: Mathieu Desnoyers --- README | 13 +++++++++++++ urcu-pointer.h | 6 +++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/README b/README index 218b4be..77fe360 100644 --- a/README +++ b/README @@ -101,6 +101,19 @@ Usage of all urcu libraries instead of inlines, so your application can link with the library. * Linking with one of the libraries below is always necessary even for LGPL and GPL applications. + * Define URCU_INLINE_SMALL_FUNCTIONS before including Userspace RCU + headers if you want Userspace RCU to inline small functions (10 + lines or less) into the application. It can be used by applications + distributed under any kind of license, and does *not* make the + application a derived work of Userspace RCU. + + Those small inlined functions are guaranteed to match the library + content as long as the library major version is unchanged. + Therefore, the application *must* be compiled with headers matching + the library major version number. Applications using + URCU_INLINE_SMALL_FUNCTIONS may be unable to use debugging + features of Userspace RCU without being recompiled. + Usage of liburcu diff --git a/urcu-pointer.h b/urcu-pointer.h index 03bfe79..5be986c 100644 --- a/urcu-pointer.h +++ b/urcu-pointer.h @@ -34,7 +34,7 @@ extern "C" { #endif -#ifdef _LGPL_SOURCE +#if defined(_LGPL_SOURCE) || defined(URCU_INLINE_SMALL_FUNCTIONS) #include @@ -62,7 +62,7 @@ extern "C" { #define rcu_xchg_pointer _rcu_xchg_pointer #define rcu_set_pointer _rcu_set_pointer -#else /* !_LGPL_SOURCE */ +#else /* !(defined(_LGPL_SOURCE) || defined(URCU_INLINE_SMALL_FUNCTIONS)) */ extern void *rcu_dereference_sym(void *p); #define rcu_dereference(p) \ @@ -108,7 +108,7 @@ extern void *rcu_set_pointer_sym(void **p, void *v); _________pv); \ } while (0) -#endif /* !_LGPL_SOURCE */ +#endif /* !(defined(_LGPL_SOURCE) || defined(URCU_INLINE_SMALL_FUNCTIONS)) */ /* * void rcu_assign_pointer(type *ptr, type *new) -- 2.34.1