Fix mistake: using incorrect size

This commit is contained in:
Jean Pierre Cimalando 2021-03-31 17:12:00 +02:00
parent cb9d61757d
commit 28f44afb4a

View file

@ -22,7 +22,7 @@ T* alignedNew(Args&& ...args)
struct deleter { struct deleter {
void operator()(T* x) const noexcept { allocator().deallocate(x, sizeof(T)); } void operator()(T* x) const noexcept { allocator().deallocate(x, sizeof(T)); }
}; };
std::unique_ptr<T, deleter> ptr { allocator().allocate(sizeof(T)) }; std::unique_ptr<T, deleter> ptr { allocator().allocate(1) };
allocator().construct(ptr.get(), std::forward<Args>(args)...); allocator().construct(ptr.get(), std::forward<Args>(args)...);
return ptr.release(); return ptr.release();
} }