Commit df6799a8 authored by Nick Terrell's avatar Nick Terrell Committed by Facebook Github Bot

Fix AlignedSysAllocator converting constructor

Summary:
`align()` was private, so the converting construct didn't have access
to `other.align()`.

Reviewed By: yfeldblum

Differential Revision: D9785137

fbshipit-source-id: e64a66eccd8a8b28db27873c0aaa7305b642c926
parent 57fa26c8
......@@ -409,6 +409,9 @@ class AlignedSysAllocator : private Align {
private:
using Self = AlignedSysAllocator<T, Align>;
template <typename, typename>
friend class AlignedSysAllocator;
constexpr Align const& align() const {
return *this;
}
......
......@@ -167,6 +167,13 @@ TEST(AlignedSysAllocator, bad_alloc_default) {
}
}
TEST(AlignedSysAllocator, converting_constructor) {
using Alloc1 = AlignedSysAllocator<float>;
using Alloc2 = AlignedSysAllocator<double>;
Alloc1 const alloc1(1024);
Alloc2 const alloc2(alloc1);
}
TEST(allocate_sys_buffer, compiles) {
auto buf = allocate_sys_buffer(256);
// Freed at the end of the scope.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment