diff options
| author | Mattias EngdegÄrd | 2024-05-26 13:44:32 +0200 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2025-07-10 10:24:58 +0200 |
| commit | cd3727f7e0607a152a97b534ee09a2cb8ac6cb84 (patch) | |
| tree | 721a0f3e066b4fcafc7e7f15a21f5cee4128f59e /java/org | |
| parent | 99080d0c04931b5d45026e1ee44526bbbb8dfdef (diff) | |
| download | emacs-cd3727f7e0607a152a97b534ee09a2cb8ac6cb84.tar.gz emacs-cd3727f7e0607a152a97b534ee09a2cb8ac6cb84.zip | |
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.
Diffstat (limited to 'java/org')
0 files changed, 0 insertions, 0 deletions