job/queue: remove use of deprecated aligned_storage_t

This commit is contained in:
Danny Robson 2023-05-15 10:31:17 +10:00
parent f7ac00a7ce
commit 537e5d40a8

View File

@ -156,14 +156,14 @@ namespace cruft::job {
{
static_assert (sizeof (tuple_t) <= sizeof data);
//tuple_t &punned = *reinterpret_cast<tuple_t*> (&data);
new (reinterpret_cast<tuple_t*> (&data)) tuple_t (
new (cruft::cast::alignment<tuple_t*> (data)) tuple_t (
std::forward<FunctionT> (func),
{ std::forward<Args> (params)... }
);
}
function = [] (task &base) {
auto &punned = *reinterpret_cast<tuple_t*> (&base.data);
auto &punned = *cruft::cast::alignment<tuple_t*> (&base);
std::apply (std::get<0> (punned), std::get<1> (punned));
};
}
@ -174,7 +174,7 @@ namespace cruft::job {
// GCC: switch to hardware_destructive_interference_size when it
// becomes available in libstdc++. Until then we use a sensible
// guess.
std::aligned_storage_t<64,alignof(std::max_align_t)> data;
alignas(64) u08 data[64];
std::function<void(task&)> function;
thread::semaphore references = 0;