]> Savannah Git Hosting - gnulib.git/commit
xalloc-oversized: fix SIZE_MAX optimization bug
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 18 Apr 2021 23:30:59 +0000 (16:30 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 19 Apr 2021 03:59:52 +0000 (20:59 -0700)
commit6c9d1972b202299f6f4e41ec810e13d17be605e2
tree852a241d385b44ea0178e33bf50090bb9766929f
parent109f6d1f8c520a0c2cfeee940a9671c83361a8c1
xalloc-oversized: fix SIZE_MAX optimization bug

* lib/xalloc-oversized.h (xalloc_count_t): Remove; no longer
needed and was evidently error-prone anyway.
(xalloc_oversized): Omit some over-optimization that caused
SIZE_MAX to not be treated as too large (the Gnulib convention) on
unusual platforms where PTRDIFF_MAX == SIZE_MAX.  This change
should not affect typical platforms where PTRDIFF_MAX < SIZE_MAX.
When optimizing, simply use ptrdiff_t instead of xalloc_count_t.
ChangeLog
lib/xalloc-oversized.h