lua-users home
lua-l archive

Re: Compilation warnings

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,
Roberto Ierusalimschy wrote:
> > Using MAX_SIZET/2 is probably safer, but too limiting for 16 bit
> > platforms (some have a 16 bit size_t and a 32 bit ptrdiff_t).
> 
> Maybe ptrdiff_max would be more appropriate.
Umm, no. This leads to size_t overflow on 16 bit platforms.
MAX_ALLOC = min(MAX_SIZET, MAX_PTRDIFFT) - safety_margin
Bye,
 Mike

AltStyle によって変換されたページ (->オリジナル) /