diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-03-24 14:44:28 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-03-24 14:44:28 +0000 |
commit | 7b734803d2ca6996dddda574daf78d9957b470cd (patch) | |
tree | 3541e63b0b0a5c99f011f6343332bc978afca5d3 /regexec.c | |
parent | a86a1ca71b6cc69a4a01c17f91f95d556810d9f3 (diff) | |
download | perl-7b734803d2ca6996dddda574daf78d9957b470cd.tar.gz |
startp and endp can allocate their array of I32s from the same block of
memory, and Copy() and free it as one.
Probably these two pointers to array should merge into single pointer
to an array of structs.
p4raw-id: //depot/perl@30745
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1663,8 +1663,8 @@ S_swap_match_buff (pTHX_ regexp *prog) { */ Newxz(prog->swap, 1, regexp_paren_ofs); /* no need to copy these */ - Newxz(prog->swap->startp, prog->nparens + 1, I32); - Newxz(prog->swap->endp, prog->nparens + 1, I32); + Newxz(prog->swap->startp, 2 * (prog->nparens + 1), I32); + prog->swap->endp = prog->swap->startp + prog->nparens + 1; } t = prog->swap->startp; prog->swap->startp = prog->startp; |