[*] ...linux
This commit is contained in:
parent
86e556a9bb
commit
540c5826d8
@ -516,7 +516,7 @@ namespace Aurora::Async
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ASYNC_ERROR(exp) if constexpr (std::is_same_v<T, bool>) { SysPushErrorGen(exp); return {}; } else { throw std::exception(exp); }
|
#define ASYNC_ERROR(exp) if constexpr (std::is_same_v<T, bool>) { SysPushErrorGen(exp); return {}; } else { throw std::string(exp); }
|
||||||
#define ASYNC_FINISH if constexpr (std::is_same_v<T, bool>) { return true; }
|
#define ASYNC_FINISH if constexpr (std::is_same_v<T, bool>) { return true; }
|
||||||
|
|
||||||
template<typename T = void, typename... Args, AU_TEMPLATE_ENABLE_WHEN(std::is_same_v<T, bool> || std::is_void<T>::value)>
|
template<typename T = void, typename... Args, AU_TEMPLATE_ENABLE_WHEN(std::is_same_v<T, bool> || std::is_void<T>::value)>
|
||||||
@ -548,7 +548,7 @@ namespace Aurora::Async
|
|||||||
{
|
{
|
||||||
auto work = AuMakeShared<BasicWorkCallback<AVoid, B>>();
|
auto work = AuMakeShared<BasicWorkCallback<AVoid, B>>();
|
||||||
if (!work) ASYNC_ERROR("can't dispatch async call; out of memory");
|
if (!work) ASYNC_ERROR("can't dispatch async call; out of memory");
|
||||||
work.task.onProcess = [](const AVoid &) -> AuOptional<B>
|
work.task.onProcess = [=](const AVoid &) -> AuOptional<B>
|
||||||
{
|
{
|
||||||
return func(in...);
|
return func(in...);
|
||||||
};
|
};
|
||||||
|
@ -53,14 +53,14 @@ namespace Aurora::Memory
|
|||||||
T *NewArray(Types::size_t count)
|
T *NewArray(Types::size_t count)
|
||||||
{
|
{
|
||||||
static_assert(!std::is_class<T>::value, "Do not use heap/kmem apis with classes");
|
static_assert(!std::is_class<T>::value, "Do not use heap/kmem apis with classes");
|
||||||
return FAlloc<T *>(count * sizeof(T));
|
return reinterpret_cast<T *>(_FAlloc(count * sizeof(T)));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T *NewArray(Types::size_t count, Types::size_t align)
|
T *NewArray(Types::size_t count, Types::size_t align)
|
||||||
{
|
{
|
||||||
static_assert(!std::is_class<T>::value, "Do not use heap/kmem apis with classes");
|
static_assert(!std::is_class<T>::value, "Do not use heap/kmem apis with classes");
|
||||||
return FAlloc<T *>(count * sizeof(T), align);
|
return reinterpret_cast<T *>(_FAlloc(count * sizeof(T)), align);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
Loading…
Reference in New Issue
Block a user