From: Nicholas Clark Date: Fri, 18 Nov 2005 21:02:34 +0000 (+0000) Subject: Merge the arms of the switch. The decision about what comes from an X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c22188b4642a3119b38292466ab0fa0dc4f43376;p=p5sagit%2Fp5-mst-13.2.git Merge the arms of the switch. The decision about what comes from an arena and what comes from malloc is now solely in the table. p4raw-id: //depot/perl@26167 --- diff --git a/sv.c b/sv.c index 7bacc94..e67c716 100644 --- a/sv.c +++ b/sv.c @@ -10066,35 +10066,30 @@ Perl_sv_dup(pTHX_ SV *sstr, CLONE_PARAMS* param) (IV)SvTYPE(sstr)); break; - case SVt_PVIO: - case SVt_PVFM: - new_body = new_NOARENA(sv_type_details); - break; - - case SVt_PVHV: - goto new_body; - case SVt_PVAV: - goto new_body; case SVt_PVGV: if (GvUNIQUE((GV*)sstr)) { /* Do sharing here, and fall through */ } + case SVt_PVIO: + case SVt_PVFM: + case SVt_PVHV: + case SVt_PVAV: case SVt_PVBM: case SVt_PVCV: case SVt_PVLV: case SVt_PVMG: case SVt_PVNV: - goto new_body; - case SVt_PVIV: - goto new_body; case SVt_PV: - new_body: assert(sv_type_details->copy); #ifndef PURIFY - new_body_inline(new_body, sv_type_details->copy, sv_type); - - new_body = (void*)((char*)new_body + sv_type_details->offset); + if (sv_type_details->arena) { + new_body_inline(new_body, sv_type_details->copy, sv_type); + new_body + = (void*)((char*)new_body + sv_type_details->offset); + } else { + new_body = new_NOARENA(sv_type_details); + } #else /* We always allocated the full length item with PURIFY */ new_body = new_NOARENA(sv_type_details);