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] Saturating using arithmetic in address calculation.


OndÅej BÃlka wrote:
> After pondering that a bit I come to that what is really needed is
> computing size in saturated arithmetic.

Yes, that's the convention used in parts of gnulib.
SIZE_MAX means "the size calculation overflowed",
and the assumption is that malloc (SIZE_MAX) fails.

We don't attempt to optimize this at the machine
code level, as the small improvement in performance
isn't worth the portability hassle for us; but it might
be worth doing in glibc.


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