This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug malloc/20137] aligned_alloc should fail for bad size / alignment [DR#460]


https://sourceware.org/bugzilla/show_bug.cgi?id=20137

--- Comment #5 from Martin Sebor <msebor at redhat dot com> ---
Let me see if Clark remembers why he made the behavior undefined in N1397.  The
intent of DR 460 was only to make the function more usable in portable programs
by removing the undefined behavior.  I did look at APIs like posix_memalign and
memalign but it didn't occur to me to relax the size constraint even further to
match theirs.  I can't think of a reason why the size should be required to be
a multiple of alignment (greater than or equal to it should suffice).

Making this change would also be in line with Clark's C++ overaligned memory
allocation proposal (P0035R1) where the overaligned operator new accepts any
such size, and explicitly calls out using aligned_alloc as a possible (though
not required) implementation.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]