mirror of
https://github.com/matrix-construct/construct
synced 2024-12-24 14:34:00 +01:00
ircd: Various symbol surface reductions and sorting.
This commit is contained in:
parent
04558290c0
commit
e51b855f2b
20 changed files with 82 additions and 51 deletions
|
@ -275,14 +275,14 @@ struct ircd::allocator::callback<T>::allocator
|
|||
};
|
||||
|
||||
template<class T>
|
||||
typename ircd::allocator::callback<T>::allocator
|
||||
inline typename ircd::allocator::callback<T>::allocator
|
||||
ircd::allocator::callback<T>::operator()()
|
||||
{
|
||||
return ircd::allocator::callback<T>::allocator(*this);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
ircd::allocator::callback<T>::operator
|
||||
inline ircd::allocator::callback<T>::operator
|
||||
allocator()
|
||||
{
|
||||
return ircd::allocator::callback<T>::allocator(*this);
|
||||
|
@ -423,7 +423,7 @@ struct ircd::allocator::fixed<T, SIZE>::allocator
|
|||
|
||||
template<class T,
|
||||
size_t SIZE>
|
||||
typename ircd::allocator::fixed<T, SIZE>::allocator
|
||||
inline typename ircd::allocator::fixed<T, SIZE>::allocator
|
||||
ircd::allocator::fixed<T, SIZE>::operator()()
|
||||
{
|
||||
return ircd::allocator::fixed<T, SIZE>::allocator(*this);
|
||||
|
@ -431,7 +431,7 @@ ircd::allocator::fixed<T, SIZE>::operator()()
|
|||
|
||||
template<class T,
|
||||
size_t SIZE>
|
||||
ircd::allocator::fixed<T, SIZE>::operator
|
||||
inline ircd::allocator::fixed<T, SIZE>::operator
|
||||
allocator()
|
||||
{
|
||||
return ircd::allocator::fixed<T, SIZE>::allocator(*this);
|
||||
|
@ -541,14 +541,14 @@ struct ircd::allocator::dynamic<T>::allocator
|
|||
};
|
||||
|
||||
template<class T>
|
||||
typename ircd::allocator::dynamic<T>::allocator
|
||||
inline typename ircd::allocator::dynamic<T>::allocator
|
||||
ircd::allocator::dynamic<T>::operator()()
|
||||
{
|
||||
return ircd::allocator::dynamic<T>::allocator(*this);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
ircd::allocator::dynamic<T>::operator
|
||||
inline ircd::allocator::dynamic<T>::operator
|
||||
allocator()
|
||||
{
|
||||
return ircd::allocator::dynamic<T>::allocator(*this);
|
||||
|
@ -771,7 +771,7 @@ struct ircd::allocator::twolevel<T, L0_SIZE>::allocator
|
|||
|
||||
template<class T,
|
||||
size_t L0_SIZE>
|
||||
typename ircd::allocator::twolevel<T, L0_SIZE>::allocator
|
||||
inline typename ircd::allocator::twolevel<T, L0_SIZE>::allocator
|
||||
ircd::allocator::twolevel<T, L0_SIZE>::operator()()
|
||||
{
|
||||
return ircd::allocator::twolevel<T, L0_SIZE>::allocator(*this);
|
||||
|
@ -779,7 +779,7 @@ ircd::allocator::twolevel<T, L0_SIZE>::operator()()
|
|||
|
||||
template<class T,
|
||||
size_t L0_SIZE>
|
||||
ircd::allocator::twolevel<T, L0_SIZE>::operator
|
||||
inline ircd::allocator::twolevel<T, L0_SIZE>::operator
|
||||
allocator()
|
||||
{
|
||||
return ircd::allocator::twolevel<T, L0_SIZE>::allocator(*this);
|
||||
|
|
|
@ -24,7 +24,8 @@ namespace ircd::cl
|
|||
void log_platform_info();
|
||||
}
|
||||
|
||||
class ircd::cl::init
|
||||
class [[gnu::visibility("hidden")]]
|
||||
ircd::cl::init
|
||||
{
|
||||
size_t init_platforms();
|
||||
size_t init_devices();
|
||||
|
|
|
@ -116,7 +116,8 @@ struct ircd::client::settings
|
|||
static ircd::conf::item<size_t> max_client_per_peer;
|
||||
};
|
||||
|
||||
struct ircd::client::init
|
||||
struct [[gnu::visibility("hidden")]]
|
||||
ircd::client::init
|
||||
{
|
||||
init();
|
||||
~init() noexcept;
|
||||
|
|
|
@ -46,7 +46,8 @@ namespace ircd
|
|||
/// own after receiving an interruption without help from this action. Common
|
||||
/// use for this is with yields to asio.
|
||||
///
|
||||
struct ircd::ctx::continuation
|
||||
struct [[gnu::visibility("hidden")]]
|
||||
ircd::ctx::continuation
|
||||
{
|
||||
static const predicate asio_predicate;
|
||||
static const predicate true_predicate;
|
||||
|
|
|
@ -49,7 +49,8 @@ struct ircd::ctx::ole::opts
|
|||
int8_t prio {0};
|
||||
};
|
||||
|
||||
struct ircd::ctx::ole::init
|
||||
struct [[gnu::visibility("hidden")]]
|
||||
ircd::ctx::ole::init
|
||||
{
|
||||
init();
|
||||
~init() noexcept;
|
||||
|
|
|
@ -83,7 +83,8 @@ namespace ircd
|
|||
}
|
||||
|
||||
/// Database subsystem initialization and destruction
|
||||
struct ircd::db::init
|
||||
struct [[gnu::visibility("hidden")]]
|
||||
ircd::db::init
|
||||
{
|
||||
static const std::string direct_io_test_file_path;
|
||||
|
||||
|
|
|
@ -220,7 +220,7 @@ namespace ircd
|
|||
|
||||
template<class E,
|
||||
class... args>
|
||||
std::exception_ptr
|
||||
inline std::exception_ptr
|
||||
ircd::make_exception_ptr(args&&... a)
|
||||
try
|
||||
{
|
||||
|
@ -232,14 +232,14 @@ catch(const E &)
|
|||
};
|
||||
|
||||
template<class... args>
|
||||
void
|
||||
inline void
|
||||
ircd::throw_system_error(args&&... a)
|
||||
{
|
||||
throw make_system_error(std::forward<args>(a)...);
|
||||
}
|
||||
|
||||
template<class... args>
|
||||
std::exception_ptr
|
||||
inline std::exception_ptr
|
||||
ircd::make_system_eptr(args&&... a)
|
||||
{
|
||||
return std::make_exception_ptr(make_system_error(std::forward<args>(a)...));
|
||||
|
|
|
@ -84,7 +84,8 @@ struct ircd::fs::aio::stats
|
|||
stats();
|
||||
};
|
||||
|
||||
struct ircd::fs::aio::init
|
||||
struct [[gnu::visibility("hidden")]]
|
||||
ircd::fs::aio::init
|
||||
{
|
||||
init();
|
||||
~init() noexcept;
|
||||
|
|
|
@ -78,7 +78,8 @@ namespace ircd::fs
|
|||
}
|
||||
|
||||
/// Filesystem interface init / fini held by ircd::main().
|
||||
struct ircd::fs::init
|
||||
struct [[gnu::visibility("hidden")]]
|
||||
ircd::fs::init
|
||||
{
|
||||
iou::init _iou_;
|
||||
aio::init _aio_;
|
||||
|
|
|
@ -89,7 +89,8 @@ enum ircd::fs::iou::state
|
|||
|
||||
/// Internal use; this is simply declared here for when internal headers are
|
||||
/// not available for this build so a weak no-op definition can be defined.
|
||||
struct ircd::fs::iou::init
|
||||
struct [[gnu::visibility("hidden")]]
|
||||
ircd::fs::iou::init
|
||||
{
|
||||
init();
|
||||
~init() noexcept;
|
||||
|
|
|
@ -28,7 +28,8 @@ namespace ircd::magic
|
|||
extern const info::versions version_api, version_abi;
|
||||
}
|
||||
|
||||
struct ircd::magic::init
|
||||
struct [[gnu::visibility("hidden")]]
|
||||
ircd::magic::init
|
||||
{
|
||||
init();
|
||||
~init() noexcept;
|
||||
|
|
|
@ -27,12 +27,6 @@ namespace ircd::magick
|
|||
extern const info::versions version_api, version_abi;
|
||||
}
|
||||
|
||||
struct ircd::magick::init
|
||||
{
|
||||
init();
|
||||
~init() noexcept;
|
||||
};
|
||||
|
||||
/// Composite thumbnailer to resize close to the requested dimension but
|
||||
/// preserving original aspect ratio; then crop to requested dimension.
|
||||
struct ircd::magick::thumbcrop
|
||||
|
@ -111,6 +105,13 @@ struct ircd::magick::job
|
|||
std::exception_ptr eptr; // apropos exception reference
|
||||
};
|
||||
|
||||
struct [[gnu::visibility("hidden")]]
|
||||
ircd::magick::init
|
||||
{
|
||||
init();
|
||||
~init() noexcept;
|
||||
};
|
||||
|
||||
// inline stubs when magick disabled/unavailable.
|
||||
#if !IRCD_USE_MAGICK
|
||||
|
||||
|
|
|
@ -73,7 +73,8 @@ namespace ircd
|
|||
using net::socket;
|
||||
}
|
||||
|
||||
struct ircd::net::init
|
||||
struct [[gnu::visibility("hidden")]]
|
||||
ircd::net::init
|
||||
{
|
||||
init();
|
||||
~init() noexcept;
|
||||
|
|
|
@ -129,7 +129,7 @@ struct ircd::net::socket
|
|||
};
|
||||
|
||||
template<class... args>
|
||||
auto
|
||||
inline auto
|
||||
ircd::net::socket::operator()(args&&... a)
|
||||
{
|
||||
return this->wait(std::forward<args>(a)...);
|
||||
|
|
|
@ -212,7 +212,8 @@ class ircd::openssl::bignum
|
|||
~bignum() noexcept;
|
||||
};
|
||||
|
||||
struct ircd::openssl::init
|
||||
struct [[gnu::visibility("hidden")]]
|
||||
ircd::openssl::init
|
||||
{
|
||||
init();
|
||||
~init() noexcept;
|
||||
|
|
|
@ -63,7 +63,8 @@ namespace ircd::server
|
|||
|
||||
/// Subsystem initialization / destruction from ircd::main
|
||||
///
|
||||
struct ircd::server::init
|
||||
struct [[gnu::visibility("hidden")]]
|
||||
ircd::server::init
|
||||
{
|
||||
// manual control panel
|
||||
static void interrupt();
|
||||
|
|
|
@ -24,6 +24,10 @@ AM_CPPFLAGS = \
|
|||
AM_LDFLAGS = \
|
||||
-version-info 3:2:0 \
|
||||
-Wl,--no-undefined-version \
|
||||
-Wl,--icf=all \
|
||||
-Wl,--no-text-reorder \
|
||||
-Wl,--sort-section=name \
|
||||
-Wl,--sort-common=descending \
|
||||
-Wl,--weak-unresolved-symbols \
|
||||
-Wl,--unresolved-symbols=ignore-in-shared-libs \
|
||||
-Wl,--wrap=pthread_create \
|
||||
|
|
25
ircd/ctx.cc
25
ircd/ctx.cc
|
@ -64,7 +64,7 @@ ircd::ctx::ctx::ios_handler
|
|||
};
|
||||
|
||||
/// Points to the next context to spawn (internal use)
|
||||
[[gnu::visibility("internal")]]
|
||||
[[gnu::visibility("hidden")]]
|
||||
decltype(ircd::ctx::ctx::spawning)
|
||||
ircd::ctx::ctx::spawning;
|
||||
|
||||
|
@ -74,6 +74,7 @@ decltype(ircd::ctx::ctx::adjoindre)
|
|||
ircd::ctx::ctx::adjoindre;
|
||||
|
||||
/// Internal context struct ctor
|
||||
[[gnu::visibility("hidden")]]
|
||||
ircd::ctx::ctx::ctx(const string_view &name,
|
||||
const ircd::ctx::stack &stack,
|
||||
const context::flags &flags)
|
||||
|
@ -93,6 +94,7 @@ ircd::ctx::ctx::ctx(const string_view &name,
|
|||
strlcpy(this->name, name);
|
||||
}
|
||||
|
||||
[[gnu::visibility("hidden")]]
|
||||
ircd::ctx::ctx::~ctx()
|
||||
noexcept
|
||||
{
|
||||
|
@ -100,6 +102,7 @@ noexcept
|
|||
}
|
||||
|
||||
/// Internal wrapper for asio::spawn; never call directly.
|
||||
[[gnu::visibility("hidden")]]
|
||||
void
|
||||
IRCD_CTX_STACK_PROTECT
|
||||
ircd::ctx::ctx::spawn(context::function func)
|
||||
|
@ -160,6 +163,7 @@ ircd::ctx::ctx::spawn(context::function func)
|
|||
///
|
||||
/// This function is the first thing executed on the new context's stack
|
||||
/// and calls the user's function.
|
||||
[[gnu::visibility("hidden")]]
|
||||
void
|
||||
IRCD_CTX_STACK_PROTECT
|
||||
ircd::ctx::ctx::operator()(boost::asio::yield_context yc,
|
||||
|
@ -232,6 +236,7 @@ catch(const std::exception &e)
|
|||
///
|
||||
/// This currently doesn't work yet because the suspension state of this
|
||||
/// context has to be ready to be jumped to and that isn't implemented yet.
|
||||
[[gnu::visibility("hidden")]]
|
||||
void
|
||||
IRCD_CTX_STACK_PROTECT
|
||||
ircd::ctx::ctx::jump()
|
||||
|
@ -265,7 +270,7 @@ ircd::ctx::ctx::jump()
|
|||
/// considered handled an another attempt to `wait()` can be made. Returns true
|
||||
/// if the context suspended and was notified. When a context wakes up the
|
||||
/// note counter is reset.
|
||||
[[gnu::hot]]
|
||||
[[gnu::visibility("hidden"), gnu::hot]]
|
||||
bool
|
||||
IRCD_CTX_STACK_PROTECT
|
||||
ircd::ctx::ctx::wait()
|
||||
|
@ -320,6 +325,7 @@ ircd::ctx::ctx::wait()
|
|||
///
|
||||
/// Returns true if this note was the first note received by this context
|
||||
/// while it's been suspended or false if it's already been notified.
|
||||
[[gnu::visibility("hidden"), gnu::hot]]
|
||||
bool
|
||||
ircd::ctx::ctx::note()
|
||||
noexcept
|
||||
|
@ -334,6 +340,7 @@ noexcept
|
|||
}
|
||||
|
||||
/// Wakes a context without a note (internal)
|
||||
[[gnu::visibility("hidden"), gnu::hot]]
|
||||
bool
|
||||
ircd::ctx::ctx::wake()
|
||||
noexcept try
|
||||
|
@ -370,7 +377,7 @@ catch(const std::exception &e)
|
|||
|
||||
/// Throws if this context has been flagged for interruption and clears
|
||||
/// the flag.
|
||||
[[gnu::hot]]
|
||||
[[gnu::visibility("hidden"), gnu::hot]]
|
||||
void
|
||||
ircd::ctx::ctx::interruption_point()
|
||||
{
|
||||
|
@ -390,7 +397,7 @@ ircd::ctx::ctx::interruption_point()
|
|||
/// Returns true if this context has been flagged for termination. Does not
|
||||
/// clear the flag. Sets the NOINTERRUPT flag so the context cannot be further
|
||||
// interrupted which simplifies the termination process.
|
||||
[[gnu::hot]]
|
||||
[[gnu::visibility("hidden"), gnu::hot]]
|
||||
bool
|
||||
ircd::ctx::ctx::termination_point(std::nothrow_t)
|
||||
noexcept
|
||||
|
@ -407,7 +414,7 @@ noexcept
|
|||
|
||||
/// Returns true if this context has been flagged for interruption and
|
||||
/// clears the flag.
|
||||
[[gnu::hot]]
|
||||
[[gnu::visibility("hidden"), gnu::hot]]
|
||||
bool
|
||||
ircd::ctx::ctx::interruption_point(std::nothrow_t)
|
||||
noexcept
|
||||
|
@ -424,7 +431,7 @@ noexcept
|
|||
|
||||
/// True if this context has been flagged for interruption or termination
|
||||
/// and interrupts are not blocked.
|
||||
[[gnu::hot]]
|
||||
[[gnu::visibility("hidden"), gnu::hot]]
|
||||
bool
|
||||
ircd::ctx::ctx::interruption()
|
||||
const noexcept
|
||||
|
@ -447,7 +454,7 @@ const noexcept
|
|||
return true;
|
||||
}
|
||||
|
||||
[[gnu::hot]]
|
||||
[[gnu::visibility("hidden"), gnu::hot]]
|
||||
bool
|
||||
ircd::ctx::ctx::started()
|
||||
const noexcept
|
||||
|
@ -455,7 +462,7 @@ const noexcept
|
|||
return stack.base != 0;
|
||||
}
|
||||
|
||||
[[gnu::hot]]
|
||||
[[gnu::visibility("hidden"), gnu::hot]]
|
||||
bool
|
||||
ircd::ctx::ctx::finished()
|
||||
const noexcept
|
||||
|
@ -825,6 +832,7 @@ ircd::ctx::this_ctx::wait()
|
|||
c.wait(); // now you're yielding with portals
|
||||
}
|
||||
|
||||
[[gnu::hot, gnu::noinline]]
|
||||
size_t
|
||||
ircd::ctx::this_ctx::stack_at_here()
|
||||
{
|
||||
|
@ -834,6 +842,7 @@ ircd::ctx::this_ctx::stack_at_here()
|
|||
|
||||
/// Throws interrupted if the currently running context was interrupted
|
||||
/// and clears the interrupt flag.
|
||||
[[gnu::hot]]
|
||||
void
|
||||
ircd::ctx::this_ctx::interruption_point()
|
||||
{
|
||||
|
|
|
@ -22,20 +22,20 @@
|
|||
/// The resolution is very low at 10ms but it is not expensive to use.
|
||||
//#define RB_DEBUG_FS_AIO_SUBMIT_BLOCKING
|
||||
|
||||
#pragma GCC visibility push(hidden)
|
||||
namespace ircd::fs::aio
|
||||
{
|
||||
struct system;
|
||||
struct request;
|
||||
|
||||
size_t write(const fd &, const const_iovec_view &, const write_opts &);
|
||||
size_t read(const vector_view<read_op> &);
|
||||
size_t read(const fd &, const const_iovec_view &, const read_opts &);
|
||||
size_t fsync(const fd &, const sync_opts &);
|
||||
}
|
||||
#pragma GCC visibility pop
|
||||
|
||||
/// AIO context instance from the system. Right now this is a singleton with
|
||||
/// an extern instance pointer at fs::aio::context maintained by fs::aio::init.
|
||||
struct ircd::fs::aio::system
|
||||
struct [[gnu::visibility("hidden")]]
|
||||
ircd::fs::aio::system
|
||||
{
|
||||
struct aio_context;
|
||||
|
||||
|
@ -100,7 +100,8 @@ struct ircd::fs::aio::system
|
|||
~system() noexcept;
|
||||
};
|
||||
|
||||
struct ircd::fs::aio::system::aio_context
|
||||
struct [[gnu::visibility("internal")]]
|
||||
ircd::fs::aio::system::aio_context
|
||||
{
|
||||
static constexpr uint MAGIC {0xA10A10A1};
|
||||
|
||||
|
@ -117,7 +118,8 @@ struct ircd::fs::aio::system::aio_context
|
|||
// 128 bytes + ring size
|
||||
|
||||
/// Generic request control block.
|
||||
struct ircd::fs::aio::request
|
||||
struct [[gnu::visibility("hidden")]]
|
||||
ircd::fs::aio::request
|
||||
:iocb
|
||||
{
|
||||
struct read;
|
||||
|
@ -152,7 +154,8 @@ struct ircd::fs::aio::request
|
|||
};
|
||||
|
||||
/// Read request control block
|
||||
struct ircd::fs::aio::request::read
|
||||
struct [[gnu::visibility("hidden")]]
|
||||
ircd::fs::aio::request::read
|
||||
:request
|
||||
{
|
||||
read(ctx::dock &, const int &fd, const read_opts &, const const_iovec_view &);
|
||||
|
@ -160,7 +163,8 @@ struct ircd::fs::aio::request::read
|
|||
};
|
||||
|
||||
/// Write request control block
|
||||
struct ircd::fs::aio::request::write
|
||||
struct [[gnu::visibility("hidden")]]
|
||||
ircd::fs::aio::request::write
|
||||
:request
|
||||
{
|
||||
write(ctx::dock &, const int &fd, const write_opts &, const const_iovec_view &);
|
||||
|
@ -168,7 +172,8 @@ struct ircd::fs::aio::request::write
|
|||
};
|
||||
|
||||
/// fsync request control block
|
||||
struct ircd::fs::aio::request::fsync
|
||||
struct [[gnu::visibility("hidden")]]
|
||||
ircd::fs::aio::request::fsync
|
||||
:request
|
||||
{
|
||||
fsync(ctx::dock &, const int &fd, const sync_opts &);
|
||||
|
|
|
@ -12,17 +12,17 @@
|
|||
#define HAVE_FS_IOU_H
|
||||
#include <linux/io_uring.h>
|
||||
|
||||
#pragma GCC visibility push(hidden)
|
||||
namespace ircd::fs::iou
|
||||
{
|
||||
struct system;
|
||||
struct request;
|
||||
|
||||
size_t write(const fd &, const const_iovec_view &, const write_opts &);
|
||||
size_t read(const fd &, const const_iovec_view &, const read_opts &);
|
||||
void fsync(const fd &, const sync_opts &);
|
||||
}
|
||||
#pragma GCC visibility pop
|
||||
|
||||
struct ircd::fs::iou::system
|
||||
struct [[gnu::visibility("hidden")]]
|
||||
ircd::fs::iou::system
|
||||
{
|
||||
ctx::dock dock;
|
||||
|
||||
|
|
Loading…
Reference in a new issue