mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 08:42:34 +01:00
ircd::ios: Elide std::function for hot descriptor calls.
This commit is contained in:
parent
5151a3b934
commit
ddfac32b85
3 changed files with 6 additions and 6 deletions
|
@ -110,8 +110,8 @@ struct ircd::ios::descriptor
|
||||||
string_view name;
|
string_view name;
|
||||||
uint64_t id {++ids};
|
uint64_t id {++ids};
|
||||||
std::unique_ptr<struct stats> stats;
|
std::unique_ptr<struct stats> stats;
|
||||||
std::function<void *(handler &, const size_t &)> allocator;
|
void *(*allocator)(handler &, const size_t &);
|
||||||
std::function<void (handler &, void *const &, const size_t &)> deallocator;
|
void (*deallocator)(handler &, void *const &, const size_t &);
|
||||||
std::vector<std::array<uint64_t, 2>> history; // epoch, cycles
|
std::vector<std::array<uint64_t, 2>> history; // epoch, cycles
|
||||||
uint8_t history_pos {0};
|
uint8_t history_pos {0};
|
||||||
bool continuation {false};
|
bool continuation {false};
|
||||||
|
|
|
@ -1120,7 +1120,7 @@ ircd::fs::aio::system::handle_descriptor
|
||||||
// appears to excessively allocate and deallocate 120 bytes; this
|
// appears to excessively allocate and deallocate 120 bytes; this
|
||||||
// is a simple asynchronous operation, we can do better (and perhaps
|
// is a simple asynchronous operation, we can do better (and perhaps
|
||||||
// even better than this below).
|
// even better than this below).
|
||||||
[](auto &handler, const size_t &size)
|
[](ios::handler &handler, const size_t &size) -> void *
|
||||||
{
|
{
|
||||||
assert(ircd::fs::aio::system);
|
assert(ircd::fs::aio::system);
|
||||||
auto &system(*ircd::fs::aio::system);
|
auto &system(*ircd::fs::aio::system);
|
||||||
|
@ -1136,7 +1136,7 @@ ircd::fs::aio::system::handle_descriptor
|
||||||
},
|
},
|
||||||
|
|
||||||
// no deallocation; satisfied by class member unique_ptr
|
// no deallocation; satisfied by class member unique_ptr
|
||||||
[](auto &handler, void *const &ptr, const auto &size) {},
|
[](ios::handler &handler, void *const &ptr, const size_t &size) {},
|
||||||
|
|
||||||
// continuation
|
// continuation
|
||||||
true,
|
true,
|
||||||
|
|
|
@ -520,7 +520,7 @@ ircd::fs::iou::system::handle_descriptor
|
||||||
// appears to excessively allocate and deallocate 120 bytes; this
|
// appears to excessively allocate and deallocate 120 bytes; this
|
||||||
// is a simple asynchronous operation, we can do better (and perhaps
|
// is a simple asynchronous operation, we can do better (and perhaps
|
||||||
// even better than this below).
|
// even better than this below).
|
||||||
[](auto &handler, const size_t &size)
|
[](ios::handler &handler, const size_t &size) -> void *
|
||||||
{
|
{
|
||||||
assert(ircd::fs::iou::system);
|
assert(ircd::fs::iou::system);
|
||||||
auto &system(*ircd::fs::iou::system);
|
auto &system(*ircd::fs::iou::system);
|
||||||
|
@ -536,7 +536,7 @@ ircd::fs::iou::system::handle_descriptor
|
||||||
},
|
},
|
||||||
|
|
||||||
// no deallocation; satisfied by class member unique_ptr
|
// no deallocation; satisfied by class member unique_ptr
|
||||||
[](auto &handler, void *const &ptr, const auto &size) {}
|
[](ios::handler &handler, void *const &ptr, const size_t &size) -> void {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Handle notifications that requests are complete.
|
/// Handle notifications that requests are complete.
|
||||||
|
|
Loading…
Reference in a new issue