From: gfx Date: Sun, 15 Nov 2009 05:15:17 +0000 (+0900) Subject: Use new[HA]V_mortal() X-Git-Tag: 0.40_06~19 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=commitdiff_plain;h=6fab29c627e6fa346e3aab08de0017b46eeb3ddb Use new[HA]V_mortal() --- diff --git a/xs-src/Mouse.xs b/xs-src/Mouse.xs index 7cc9f34..3e654c4 100644 --- a/xs-src/Mouse.xs +++ b/xs-src/Mouse.xs @@ -213,8 +213,7 @@ mouse_build_args(aTHX_ SV* metaclass, SV* const klass, I32 const start, I32 cons else{ I32 i; - args = newHV(); - sv_2mortal((SV*)args); + args = newHV_mortal(); if( ((items - start) % 2) != 0 ){ if(!metaclass){ metaclass = get_metaclass(klass); } diff --git a/xs-src/MouseTypeConstraints.xs b/xs-src/MouseTypeConstraints.xs index 741e679..2f4a6b1 100644 --- a/xs-src/MouseTypeConstraints.xs +++ b/xs-src/MouseTypeConstraints.xs @@ -571,13 +571,11 @@ void compile_type_constraint(SV* self) CODE: { - AV* const checks = newAV(); + AV* const checks = newAV_mortal(); SV* check; /* check function */ SV* parent; SV* types_ref; - sv_2mortal((SV*)checks); - for(parent = get_slots(self, "parent"); parent; parent = get_slots(parent, "parent")){ check = get_slots(parent, "hand_optimized_type_constraint"); if(check && SvOK(check)){ @@ -621,8 +619,7 @@ CODE: types = (AV*)SvRV(types_ref); len = av_len(types) + 1; - union_checks = newAV(); - sv_2mortal((SV*)union_checks); + union_checks = newAV_mortal(); for(i = 0; i < len; i++){ SV* const tc = *av_fetch(types, i, TRUE);