mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-05 22:20:24 -08:00
Speed up low-level parts of the reader and refactor
Inspect the given 'readcharfun' source once, before using it, instead of for each character read. This moves a bunch of branches away from the critical path, with separate functions for different source types. Replace some preprocessor macros with functions. * src/lread.c (READCHAR, UNREAD, READCHAR_REPORT_MULTIBYTE) (FROM_FILE_P): Remove; use corresponding functions instead. All callers adapted. (source_t): New struct that takes the place of the `readcharfun` and `readbyte` arguments in many places. (init_source) (source_buffer_get, source_buffer_unget) (source_marker_get, source_marker_unget) (source_string_get, source_string_unget) (source_file_get, source_file_unget) (source_function_get, source_function_unget) (from_file_p, unreadbyte_from_file): New. (readbyte_from_stdio): Replace `readbyte_from_file`. (readchar, unreadchar): Rewrite. (lisp_file_lexical_cookie, readevalloop, read_internal_start): Create a source_t for use during reading. All signatures and functions called adapted. (read_char_escape): Remove check for an error that can no longer occur.
This commit is contained in:
parent
99080d0c04
commit
cd3727f7e0
1 changed files with 424 additions and 401 deletions
825
src/lread.c
825
src/lread.c
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue