]> git.eshelyaron.com Git - emacs.git/commit
Simplify alloc by assuming MALLOC_IS_LISP_ALIGNED
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 16 Jan 2025 07:32:43 +0000 (23:32 -0800)
committerEshel Yaron <me@eshelyaron.com>
Sat, 18 Jan 2025 22:00:57 +0000 (23:00 +0100)
commit9fb04ce7e9e7b0d89fd19523160c5acf917bb882
tree4f1498b46b8c0160c677812c172f80f687e9a0bf
parent20a82009fd52d84b33f982f2425f4b361ad04058
Simplify alloc by assuming MALLOC_IS_LISP_ALIGNED

Problem reported by Hong Xu <https://bugs.gnu.org/75551#14>.
* src/alloc.c (MALLOC_IS_LISP_ALIGNED): static_assert it,
since it is true on all current Emacs platforms.
All uses simplified to assume it is true.
(xmalloc, xzalloc, xrealloc, lisp_malloc): Just use
malloc/calloc/realloc.  Since we are using the malloc-gnu
and realloc-posix modules, we need not worry about whether
these functions return a null pointer for zero-size requests.
(xrealloc): Stop worrying about no-longer-existing platforms
where realloc (nullptr, ...) did not work.
(laligned, lmalloc, lrealloc): Remove.  All uses removed.

(cherry picked from commit d3a2ec5210746a942263d5e18ee3b8190b9698e1)
src/alloc.c