summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/shortdoc.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2020-10-24 13:41:01 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2020-10-24 14:00:13 -0700
commitd35d5c7ecde9b5003c3b21f773570800542664fa (patch)
tree6b61cc92bb2a7b0d212e876c3cf62a077e725954 /lisp/emacs-lisp/shortdoc.el
parentc3835bd3803e5f395c4ebf0b2585cc9272173548 (diff)
downloademacs-d35d5c7ecde9b5003c3b21f773570800542664fa.tar.gz
emacs-d35d5c7ecde9b5003c3b21f773570800542664fa.tar.bz2
emacs-d35d5c7ecde9b5003c3b21f773570800542664fa.zip
Improve doprnt performance
This patch implements some of my suggestions in Bug#8545, with further changes suggested by Eli Zaretskii (Bug#43439). * src/doprnt.c: Improve comments. (SIZE_BOUND_EXTRA): Now at top level, for parse_format_integer. (parse_format_integer): New static function, containing some of the old doprnt. Fix a bug that caused doprnt to infloop on formats like "%10s" that Emacs does not use. We could simplify doprnt further if we dropped support for these never-used formats. (doprnt_nul): New function. (doprnt): Use it. Change doprnt API to exit when either it finds NUL or reaches the character specified by FORMAT_END. In the typical case where FORMAT_END is null, take just one pass over FORMAT, not two. Assume C99 to make code clearer. Do not use malloc or alloca to allocate a copy of the format FMTCPY; instead, use a small fixed-size array FMTSTAR, and use '*' in that array to represent width and precision, passing them as separate int arguments. Use eassume to pacify GCC in switch statements.
Diffstat (limited to 'lisp/emacs-lisp/shortdoc.el')
0 files changed, 0 insertions, 0 deletions