This is the mail archive of the libc-alpha@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]

Re: [PATCH v3] malloc: make malloc fail with requests larger than PTRDIFF_MAX (BZ#23741)


On Tue, 9 Apr 2019, Adhemerval Zanella wrote:

> As discussed previously on libc-alpha [1], this patch follows up the idea
> and add both the __attribute_alloc_size__ on malloc functions (malloc,
> calloc, realloc, reallocarray, valloc, pvalloc, memaling, and
> posix_memalign) and limit maximum requested allocation size to up
> PTRDIFF_MAX (taking into consideration internal padding and alignment).

__attribute_alloc_size__ is for functions that return a pointer.  That is, 
it *cannot* be applied to posix_memalign (see remarks in 
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87683>).

This is an issue with the proposed commit message and ChangeLog entry, not 
the patch itself which doesn't appear to apply the attribute to 
posix_memalign after all.  The commit message should discuss why the 
attribute is not applied to posix_memalign, and the ChangeLog entry should 
not say it's being applied there.

-- 
Joseph S. Myers
joseph@codesourcery.com


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