TEST(AlignedAllocatorTest, AllocatorAlign) { AlignedAllocator<real> a; real * p = a.allocate(1000); // Mask for 128-byte alignment is 128-1 - these bits should be zero in p std::size_t mask = static_cast<std::size_t>(128-1); EXPECT_EQ(0, reinterpret_cast<std::size_t>(p) & mask); a.deallocate(p, 1000); }
aligned_padded_ptr(Ts&&... ts) : ptr(reinterpret_cast<T*>(allocator.allocate(block_size))) { make(ptr, std::forward<Ts>(ts)...); }