We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c06721c commit 148185eCopy full SHA for 148185e
sycl/include/CL/sycl/detail/aligned_allocator.hpp
@@ -53,10 +53,12 @@ template <typename T> class aligned_allocator {
53
pointer allocate(size_t Size) {
54
size_t NumBytes = Size * sizeof(value_type);
55
NumBytes = ((NumBytes - 1) | (MAlignment - 1)) + 1;
56
+ if (0 == NumBytes)
57
+ throw std::bad_alloc();
58
59
pointer Result = reinterpret_cast<pointer>(
60
detail::OSUtil::alignedAlloc(MAlignment, NumBytes));
- if (!Result || NumBytes == 0)
61
+ if (!Result)
62
throw std::bad_alloc();
63
return Result;
64
}
0 commit comments