summaryrefslogtreecommitdiff
path: root/parser.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-11-06 14:04:51 -0800
committerFather Chrysostomos <sprout@cpan.org>2011-11-06 14:23:49 -0800
commit0abcdfa4c5da571f9a31d50e4a121867868e8aaf (patch)
tree69628a02e27d839663e8073694d0c9a88a782905 /parser.h
parentbc344123285ead072c87437a15e486ff36fef609 (diff)
downloadperl-0abcdfa4c5da571f9a31d50e4a121867868e8aaf.tar.gz
Avoid redundant copies in string evals
Perl_lex_start copies the string passed to it unconditionally. Sometimes pp_entereval makes a copy before passing the string to lex_start. So in those cases we can pass a flag to avoid a redundant copy.
Diffstat (limited to 'parser.h')
-rw-r--r--parser.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/parser.h b/parser.h
index 9167e6c07f..3531631e62 100644
--- a/parser.h
+++ b/parser.h
@@ -119,8 +119,10 @@ typedef struct yy_parser {
# define LEX_START_SAME_FILTER 0x00000001
# define LEX_IGNORE_UTF8_HINTS 0x00000002
# define LEX_EVALBYTES 0x00000004
+# define LEX_START_COPIED 0x00000008
# define LEX_START_FLAGS \
- (LEX_START_SAME_FILTER|LEX_IGNORE_UTF8_HINTS|LEX_EVALBYTES)
+ (LEX_START_SAME_FILTER|LEX_START_COPIED \
+ |LEX_IGNORE_UTF8_HINTS|LEX_EVALBYTES)
#endif
/* flags for parser API */