job/queue: remove use of deprecated aligned_storage_t
This commit is contained in:
parent
f7ac00a7ce
commit
537e5d40a8
@ -156,14 +156,14 @@ namespace cruft::job {
|
|||||||
{
|
{
|
||||||
static_assert (sizeof (tuple_t) <= sizeof data);
|
static_assert (sizeof (tuple_t) <= sizeof data);
|
||||||
//tuple_t &punned = *reinterpret_cast<tuple_t*> (&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<FunctionT> (func),
|
||||||
{ std::forward<Args> (params)... }
|
{ std::forward<Args> (params)... }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function = [] (task &base) {
|
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));
|
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
|
// GCC: switch to hardware_destructive_interference_size when it
|
||||||
// becomes available in libstdc++. Until then we use a sensible
|
// becomes available in libstdc++. Until then we use a sensible
|
||||||
// guess.
|
// guess.
|
||||||
std::aligned_storage_t<64,alignof(std::max_align_t)> data;
|
alignas(64) u08 data[64];
|
||||||
|
|
||||||
std::function<void(task&)> function;
|
std::function<void(task&)> function;
|
||||||
thread::semaphore references = 0;
|
thread::semaphore references = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user