[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Very briefly, size_t versus ptrdiff_t on 64-bit systems
- From: sur-behoffski <sur_behoffski@...>
- Date: Tue, 8 Dec 2020 20:54:23 +1030
Sorry for semi-carrying on the [unsigned] int conversation, but a quick
note from some activity I saw on another very comprehensive list regarding
a utility, coded in C, and aiming for very high portability:
(These remarks only apply to systems with 64 (or more) bits for pointers.)
The maintainers on that project decided to use signed type ptrdiff_t,
instead of unsigned size_t, as the gain in being able to comprehend
over/underflow for the entities being manipulated was more valuable
than the likely (sane real-world use for the ultra-foreseeable future)
loss of one bit of integer precision.
Sorry for the non-Lua comment, but these trade-offs become more feasible
when 64-bit-plus types are readily available.
'Nuff said. I need to get back to two Lua-oriented projects that are
years-old, and (ironically) some of the trade-offs in
design/implementation that were fairly reasonable in 2015/2016 look
rather more ragged now, sigh (especially being limited to Lua-5.1 under
Gentoo GNU/Linux: Newer Lua versions are listed, but are hard-masked as
being significantly unstable within the Gentoo Portage ecosystem).
-- s-b etc etc