template<std::size_t N>inline bool IsAlignedPtr(const void *ptr) { static_assert((N & (N-1)) == 0, "N must be power of 2"); return (reinterpret_cast<std::uintptr_t>(ptr) & (N-1)) == 0;}