On 13/05/20 04:49 -0300, Alexandre Oliva wrote:
Hello, Jonathan,
On May 9, 2020, Jonathan Wakely <jwak...@redhat.com> wrote:
On 08/05/20 17:22 -0300, Alexandre Oliva wrote:
(Couldn't r1->allocate(2, alignof(char)) possibly return a pointer
that's *not* aligned<max_align_t>? Maybe we should drop the test even
if !defined(BAD_MAX_ALIGN_T).)
Yes.
Different malloc implementations interpret the C standard differently
here. One interpretation is that all allocations must be aligned to
alignof(max_align_t) but another is that allocations smaller than that
don't need to meet that requirement. An object that is two bytes in
size cannot require 16-byte alignment (otherwise its sizeof would be
16 too).
I understand you're talking about malloc because that's what our
implementation ultimately uses, but my question was on language
lawyering, on whether C++ would mandate more alignment than requested by
the caller of allocate.
No it doesn't, but this is a test for our implementation, not the
standard, and the new_delete_resource uses new which (in our
implementation) uses malloc.
That said, I'm not sure if I was really trying to test that property,
or if including that line was just a mistake. I suspect it was just a
mistake.
If it were to do so, I wonder what the point of
specifying the alignment explicitly would be.
Please do remove that line of the test, instead of wrapping it in the
#ifdef.
OK for master.
Thanks, here's what I'm installing in master.
Thanks.