From: gfx Date: Mon, 11 Jan 2010 05:49:21 +0000 (+0900) Subject: Don't create scopes as much as possible X-Git-Tag: 0.47~12 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=accc9fc204c5396f69db2b8fb445bae3faabaa8e;p=gitmo%2FMouse.git Don't create scopes as much as possible --- diff --git a/xs-src/Mouse.xs b/xs-src/Mouse.xs index 7800a86..df7ca48 100644 --- a/xs-src/Mouse.xs +++ b/xs-src/Mouse.xs @@ -253,9 +253,6 @@ mouse_class_initialize_object(pTHX_ SV* const meta, SV* const object, HV* const croak("You cannot use tied HASH reference as initializing arguments"); } - ENTER; - SAVETMPS; - if(!ignore_triggers){ triggers_queue = newAV_mortal(); } @@ -313,8 +310,6 @@ mouse_class_initialize_object(pTHX_ SV* const meta, SV* const object, HV* const set_slot(object, newSVpvs_flags("__METACLASS__", SVs_TEMP), meta); } - FREETMPS; - LEAVE; } static SV* @@ -353,7 +348,12 @@ mouse_buildall(pTHX_ AV* const xc, SV* const object, SV* const args) { PUSHs(args); PUTBACK; - call_sv(AvARRAY(buildall)[i], G_VOID | G_DISCARD); + call_sv(AvARRAY(buildall)[i], G_VOID); + + /* discard a scalar which G_VOID returns */ + SPAGAIN; + (void)POPs; + PUTBACK; } } @@ -631,7 +631,13 @@ CODE: XPUSHs(object); PUTBACK; - call_sv(AvARRAY(demolishall)[i], G_VOID | G_DISCARD | G_EVAL); + call_sv(AvARRAY(demolishall)[i], G_VOID | G_EVAL); + + /* discard a scalar which G_VOID returns */ + SPAGAIN; + (void)POPs; + PUTBACK; + if(sv_true(ERRSV)){ SV* const e = newSVsv(ERRSV);