https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108951

            Bug ID: 108951
           Summary: std::valarray doesn't support extended alignment
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

Memory for valarrays is obtained via:

  template<typename _Tp>
    inline _Tp*
    __valarray_get_storage(size_t __n)
    { return static_cast<_Tp*>(operator new(__n * sizeof(_Tp))); }

  // Return memory to the system
  inline void
  __valarray_release_memory(void* __p)
  { operator delete(__p); }


This will be wrong for types with extended alignments.

We should either copy the code from std::allocator::allocate, or just use
std::allocator<_Tp> here.

Reply via email to