diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2024-07-22 07:07:51 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2024-07-22 07:07:51 -0700 |
commit | 74d7277b99dfe15797464f41adc5204c728eca6b (patch) | |
tree | 49430c9f8b4b101b93c1dad2ed59915c62da1797 /parser.c | |
parent | a8ea27fae5dea57c9d5966d06c78ee64decfc8c7 (diff) | |
download | txr-74d7277b99dfe15797464f41adc5204c728eca6b.tar.gz txr-74d7277b99dfe15797464f41adc5204c728eca6b.tar.bz2 txr-74d7277b99dfe15797464f41adc5204c728eca6b.zip |
parser: remove some wasteful string object allocations.
* lib.c (int_str_wc): New function, made out of int_str.
This can be used by the parser to work with a wchar_t *
string without having to create a string object.
(int_str): Implemented in terms of int_str_wc.
* parser.l (grammar): Remove string_own calls from numerous
rule bodies that use int_str to return a number.
These rules now capture the wchar_t string, pass it to
int_str_wc and then immediately free it. Whereas string_own
allocates an extra object and leaves it to the garbage
collector.
* lex.yy.c.shipped: Regenerated.
Diffstat (limited to 'parser.c')
0 files changed, 0 insertions, 0 deletions