]> git.eshelyaron.com Git - emacs.git/commit
Don’t assume sizeof (size_t) == 4 in allocators
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 18 Jan 2020 21:18:27 +0000 (13:18 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 18 Jan 2020 21:21:20 +0000 (13:21 -0800)
commitb222e1aaf968b9c8da5313906ab7536a868020be
treec03701e006abdc3b4bc842b34d6b7b0f0fe1669b
parent447bb1313a6abc07776d93ee78cd976ab43856e5
Don’t assume sizeof (size_t) == 4 in allocators

This removes some old 32-bit assumptions in Emacs allocator tuning,
and improves performance of ‘make compile-always’ by about 7% on a
couple of 64-bit GNU/Linux platforms I tried it on.  It should not
affect performance on 32-bit platforms.
* src/alloc.c (MALLOC_SIZE_NEAR): New macro.
(MALLOC_ALIGNMENT): New constant.
(INTERVAL_BLOCK_SIZE, SBLOCK_SIZE, STRING_BLOCK_SIZE): Use the new
macro.  Make these enum constants since they need not be macros.
src/alloc.c