0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-19 18:38:21 +02:00

ircd::ctx: Specify inline linkage for various templates to prevent any dynsyms.

This commit is contained in:
Jason Volk 2020-07-11 15:29:13 -07:00
parent 8ffa5c55a5
commit cd95b7cd8d
5 changed files with 32 additions and 30 deletions

View file

@ -88,7 +88,7 @@ noexcept
/// Returns true if notified; false if timed out
template<class duration>
bool
inline bool
ircd::ctx::dock::wait_for(const duration &dur)
{
static const duration zero(0);
@ -110,7 +110,7 @@ ircd::ctx::dock::wait_for(const duration &dur)
/// Returns true if predicate passed; false if timed out
template<class duration>
bool
inline bool
ircd::ctx::dock::wait_for(const duration &dur,
const predicate &pred)
{
@ -148,7 +148,7 @@ ircd::ctx::dock::wait_for(const duration &dur,
/// Returns true if notified; false if timed out
template<class time_point>
bool
inline bool
ircd::ctx::dock::wait_until(time_point&& tp)
{
assert(current);
@ -168,7 +168,7 @@ ircd::ctx::dock::wait_until(time_point&& tp)
/// Returns true if predicate passed; false if timed out
template<class time_point>
bool
inline bool
ircd::ctx::dock::wait_until(time_point&& tp,
const predicate &pred)
{

View file

@ -97,6 +97,7 @@ struct ircd::ctx::scoped_future
};
template<class... T>
inline
ircd::ctx::scoped_future<T...>::~scoped_future()
noexcept
{
@ -108,7 +109,7 @@ noexcept
template<class T>
template<class time_point>
T
inline T
ircd::ctx::future<T>::get_until(const time_point &tp)
{
this->wait_until(tp);
@ -117,7 +118,7 @@ ircd::ctx::future<T>::get_until(const time_point &tp)
template<class T>
template<class duration>
T
inline T
ircd::ctx::future<T>::get(const duration &d)
{
this->wait(d);
@ -125,7 +126,7 @@ ircd::ctx::future<T>::get(const duration &d)
}
template<class T>
T
inline T
ircd::ctx::future<T>::get()
{
wait();
@ -140,7 +141,7 @@ ircd::ctx::future<T>::get()
}
template<class T>
void
inline void
ircd::ctx::future<T>::wait()
const
{
@ -156,7 +157,7 @@ const
template<class T>
template<class duration>
void
inline void
ircd::ctx::future<T>::wait(const duration &d)
const
{
@ -164,7 +165,7 @@ const
}
template<class duration>
void
inline void
ircd::ctx::future<void>::wait(const duration &d)
const
{
@ -173,7 +174,7 @@ const
template<class T>
template<class duration>
bool
inline bool
ircd::ctx::future<T>::wait(const duration &d,
std::nothrow_t)
const
@ -182,7 +183,7 @@ const
}
template<class duration>
bool
inline bool
ircd::ctx::future<void>::wait(const duration &d,
std::nothrow_t)
const
@ -192,7 +193,7 @@ const
template<class T>
template<class time_point>
void
inline void
ircd::ctx::future<T>::wait_until(const time_point &tp)
const
{
@ -201,7 +202,7 @@ const
}
template<class time_point>
void
inline void
ircd::ctx::future<void>::wait_until(const time_point &tp)
const
{
@ -211,7 +212,7 @@ const
template<class T>
template<class time_point>
bool
inline bool
ircd::ctx::future<T>::wait_until(const time_point &tp,
std::nothrow_t)
const
@ -220,7 +221,7 @@ const
}
template<class time_point>
bool
inline bool
ircd::ctx::future<void>::wait_until(const time_point &tp,
std::nothrow_t)
const
@ -239,7 +240,7 @@ const
template<class T,
class time_point>
void
inline void
ircd::ctx::wait_until(const future<T> &f,
const time_point &tp)
{
@ -249,7 +250,7 @@ ircd::ctx::wait_until(const future<T> &f,
template<class T,
class time_point>
bool
inline bool
ircd::ctx::_wait_until(const future<T> &f,
const time_point &tp,
std::nothrow_t)
@ -265,14 +266,14 @@ ircd::ctx::_wait_until(const future<T> &f,
}
template<class T>
ircd::ctx::shared_state<T> &
inline ircd::ctx::shared_state<T> &
ircd::ctx::state(future<T> &future)
{
return future.state();
}
template<class T>
const ircd::ctx::shared_state<T> &
inline const ircd::ctx::shared_state<T> &
ircd::ctx::state(const future<T> &future)
{
return future.state();

View file

@ -106,14 +106,14 @@ ircd::ctx::mutex::lock()
}
template<class duration>
bool
inline bool
ircd::ctx::mutex::try_lock_for(const duration &d)
{
return try_lock_until(system_clock::now() + d);
}
template<class time_point>
bool
inline bool
ircd::ctx::mutex::try_lock_until(const time_point &tp)
{
assert(current);

View file

@ -138,7 +138,7 @@ struct ircd::ctx::promise<void>
//
template<class T>
void
inline void
ircd::ctx::promise<T>::set_value(T&& val)
{
if(!valid())
@ -166,7 +166,7 @@ ircd::ctx::promise<T>::set_value(T&& val)
}
template<class T>
void
inline void
ircd::ctx::promise<T>::set_value(const T &val)
{
if(!valid())
@ -184,14 +184,14 @@ ircd::ctx::promise<T>::set_value(const T &val)
}
template<class T>
ircd::ctx::shared_state<T> &
inline ircd::ctx::shared_state<T> &
ircd::ctx::promise<T>::state()
{
return promise_base::state<T>();
}
template<class T>
const ircd::ctx::shared_state<T> &
inline const ircd::ctx::shared_state<T> &
ircd::ctx::promise<T>::state()
const
{
@ -233,7 +233,7 @@ const noexcept
}
template<class T>
ircd::ctx::shared_state<T> &
inline ircd::ctx::shared_state<T> &
ircd::ctx::promise_base::state()
noexcept
{
@ -241,7 +241,7 @@ noexcept
}
template<class T>
const ircd::ctx::shared_state<T> &
inline const ircd::ctx::shared_state<T> &
ircd::ctx::promise_base::state()
const noexcept
{

View file

@ -392,7 +392,7 @@ const
}
template<class T>
T
inline T
ircd::http::query::string::get(const string_view &key,
const T &def,
const size_t &idx)
@ -407,7 +407,7 @@ catch(const bad_lex_cast &)
}
template<class T>
T
inline T
ircd::http::query::string::at(const string_view &key,
const size_t &idx)
const
@ -416,6 +416,7 @@ const
}
template<class... args>
inline
ircd::http::error::error(const string_view &fmt,
const http::code &code,
args&&... a)