diff options
author | Chip Salzenberg <chip@atlantic.net> | 1997-04-01 12:01:35 +1200 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1997-04-01 12:01:35 +1200 |
commit | 1c9c84dfb2f3bf591c8f571b0d9c0e803b8609af (patch) | |
tree | 1212549e2cf7eedf9c37c0ef5fcfaf3f884bf7a4 /toke.c | |
parent | c9d716f75179fb7a413359cd6453141dfe552e82 (diff) | |
download | perl-1c9c84dfb2f3bf591c8f571b0d9c0e803b8609af.tar.gz |
Reduce memory footprint of literal strings
(this is the same change as commit 1bd69d1d0fa002def016e601cb71bfcd93600bd3, but as applied)
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -622,7 +622,11 @@ sublex_start() return THING; } if (op_type == OP_CONST || op_type == OP_READLINE) { - yylval.opval = (OP*)newSVOP(op_type, 0, q(lex_stuff)); + SV *sv = q(lex_stuff); + STRLEN len; + char *p = SvPV(sv, len); + yylval.opval = (OP*)newSVOP(op_type, 0, newSVpv(p, len)); + SvREFCNT_dec(sv); lex_stuff = Nullsv; return THING; } |