https://bugs.kde.org/show_bug.cgi?id=388787

--- Comment #1 from Paul Floyd <pa...@free.fr> ---
The LLVM libcxx implementation of aligned new does the following:

void *
operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
{
    set size to at least 1
    set align to at least size of void*
    ::posix_memalign(&p, static_cast<size_t>(alignment), size)
   if failed throw bad_alloc
   return pointer
}

The other aligned operator news just call the above one. The aligned deletes
just call ordinary delete. There is some conditional compilation for MSVCRT but
that should not be a concern.

The libstdc++ is quite similar

operator new (std::size_t sz, std::align_val_t al)
{
  set size to at least 1
  round up size to a multiple of alignment
  allocate with 'aligned_alloc' which is a wrapper around posix_memalign or
malloc if posix_memalign is not available

  if failed throw bad_alloc
   return pointer
}

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to