From 0abcdfa4c5da571f9a31d50e4a121867868e8aaf Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sun, 6 Nov 2011 14:04:51 -0800 Subject: 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. --- parser.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'parser.h') 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 */ -- cgit v1.2.1