]> git.eshelyaron.com Git - emacs.git/commit
Tune reading of radix integers
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 15 May 2019 17:26:54 +0000 (10:26 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 15 May 2019 17:27:55 +0000 (10:27 -0700)
commitd4868b2bee88c89e704b4228a34e29dfc4a9f2a5
tree716b52af67c7f615c39dc3634454feb3e6dcc400
parent32b01c02b48963a242fcc984c3599f59e59c1b2c
Tune reading of radix integers

This improves the performance of (read "%xFF") by about 25%
on my platform.
* src/lread.c: Include <vla.h>, so that we can better document
buffer sizes of arguments.
(invalid_radix_integer_format, stackbufsize): New constants.
(free_contents): Remove.  All uses removed.
(invalid_radix_integer): New function.
(read_integer): New arg STACKBUF.  Assume radix is in range.
All uses changed.  Use STACKBUF to avoid calling malloc in the
usual case.  Use grow_read_buffer to simplify.
(read1): Tune.  Improve quality of diagnostic when
MOST_POSITIVE_FIXNUM < radix <= EMACS_INT_MAX.
src/lread.c