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: RFC: __attribute_alloc_size__ on allocation functions (BZ#23741)


Adhemerval Zanella <adhemerval.zanella@linaro.org> writes:
> So I think before adding such annotation we need to discuss whether we
> want to allow such kind of allocation on malloc and mmap functions. To
> comparison:

It's relatively easy to add such a limit to malloc et al; there's
already a "request too big" macro that just needs to be adjusted (it
currently avoids unsigned overflows).

Perhaps a good compromise would be to retain current behavior for 32-bit
targets (where allocations bigger than 2Gb are realistic) but limit them
to PTRDIFF_MAX on 64 bit targets, (where a 5 exabyte allocation is not
reasonable).


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