ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Coro/State.xs
(Generate patch)

Comparing Coro/Coro/State.xs (file contents):
Revision 1.440 by root, Sat Feb 22 14:12:45 2014 UTC vs.
Revision 1.450 by root, Sun Jun 28 22:31:03 2015 UTC

42# define PadlistNAMES(pl) (*PadlistARRAY (pl)) 42# define PadlistNAMES(pl) (*PadlistARRAY (pl))
43# define PadARRAY AvARRAY 43# define PadARRAY AvARRAY
44# define PadMAX AvFILLp 44# define PadMAX AvFILLp
45# define newPADLIST(var) ((var) = newAV (), av_extend (var, 1)) 45# define newPADLIST(var) ((var) = newAV (), av_extend (var, 1))
46#endif 46#endif
47#ifndef PadnamelistREFCNT
48# define PadnamelistREFCNT(pnl) SvREFCNT (pnl)
49#endif
50#ifndef PadnamelistREFCNT_dec
51# define PadnamelistREFCNT_dec(pnl) SvREFCNT_dec (pnl)
52#endif
47 53
48/* 5.19.something has replaced SVt_BIND by SVt_INVLIST */ 54/* 5.19.something has replaced SVt_BIND by SVt_INVLIST */
49/* we just alias it to SVt_IV, as that is sufficient for swap_sv for now */ 55/* we just alias it to SVt_IV, as that is sufficient for swap_sv for now */
50#if PERL_VERSION_ATLEAST(5,19,0) 56#if PERL_VERSION_ATLEAST(5,19,0)
51# define SVt_BIND SVt_IV 57# define SVt_BIND SVt_IV
242 SV *saved_deffh; 248 SV *saved_deffh;
243 SV *invoke_cb; 249 SV *invoke_cb;
244 AV *invoke_av; 250 AV *invoke_av;
245 251
246 /* on_enter/on_leave */ 252 /* on_enter/on_leave */
247 AV *on_enter; 253 AV *on_enter; AV *on_enter_xs;
248 AV *on_leave; 254 AV *on_leave; AV *on_leave_xs;
249 255
250 /* swap_sv */ 256 /* swap_sv */
251 AV *swap_sv; 257 AV *swap_sv;
252 258
253 /* times */ 259 /* times */
489 495
490 return 0; 496 return 0;
491} 497}
492 498
493ecb_inline struct coro * 499ecb_inline struct coro *
494SvSTATE_ (pTHX_ SV *coro) 500SvSTATE_ (pTHX_ SV *coro_sv)
495{ 501{
496 MAGIC *mg; 502 MAGIC *mg;
497 503
498 if (SvROK (coro)) 504 if (SvROK (coro_sv))
499 coro = SvRV (coro); 505 coro_sv = SvRV (coro_sv);
500 506
501 mg = SvSTATEhv_p (aTHX_ coro); 507 mg = SvSTATEhv_p (aTHX_ coro_sv);
502 if (!mg) 508 if (!mg)
503 croak ("Coro::State object required"); 509 croak ("Coro::State object required");
504 510
505 return (struct coro *)mg->mg_ptr; 511 return (struct coro *)mg->mg_ptr;
506} 512}
517ecb_inline PADLIST * 523ecb_inline PADLIST *
518coro_derive_padlist (pTHX_ CV *cv) 524coro_derive_padlist (pTHX_ CV *cv)
519{ 525{
520 PADLIST *padlist = CvPADLIST (cv); 526 PADLIST *padlist = CvPADLIST (cv);
521 PADLIST *newpadlist; 527 PADLIST *newpadlist;
528 PADNAMELIST *padnames;
522 PAD *newpad; 529 PAD *newpad;
523 PADOFFSET off = PadlistMAX (padlist) + 1; 530 PADOFFSET off = PadlistMAX (padlist) + 1;
524 531
525#if NEWPADAPI 532#if NEWPADAPI
526 533
553 AvREAL_off (newpadlist); 560 AvREAL_off (newpadlist);
554#endif 561#endif
555 562
556 /* Already extended to 2 elements by newPADLIST. */ 563 /* Already extended to 2 elements by newPADLIST. */
557 PadlistMAX (newpadlist) = 1; 564 PadlistMAX (newpadlist) = 1;
558 PadlistNAMES (newpadlist) = (PADNAMELIST *)SvREFCNT_inc_NN (PadlistNAMES (padlist)); 565
566 padnames = PadlistNAMES (padlist);
567 ++PadnamelistREFCNT (padnames);
568 PadlistNAMES (newpadlist) = padnames;
569
559 PadlistARRAY (newpadlist)[1] = newpad; 570 PadlistARRAY (newpadlist)[1] = newpad;
560 571
561 return newpadlist; 572 return newpadlist;
562} 573}
563 574
584 PadMAX (pad) = -1; 595 PadMAX (pad) = -1;
585 SvREFCNT_dec (pad); 596 SvREFCNT_dec (pad);
586 } 597 }
587 } 598 }
588 599
589 SvREFCNT_dec (PadlistNAMES (padlist)); 600 PadnamelistREFCNT_dec (PadlistNAMES (padlist));
590 601
591#if NEWPADAPI 602#if NEWPADAPI
592 Safefree (PadlistARRAY (padlist)); 603 Safefree (PadlistARRAY (padlist));
593 Safefree (padlist); 604 Safefree (padlist);
594#else 605#else
769 780
770 for (i = 0; i <= AvFILLp (c->on_enter); ++i) 781 for (i = 0; i <= AvFILLp (c->on_enter); ++i)
771 on_enterleave_call (aTHX_ AvARRAY (c->on_enter)[i]); 782 on_enterleave_call (aTHX_ AvARRAY (c->on_enter)[i]);
772 } 783 }
773 784
785 if (ecb_expect_false (c->on_enter_xs))
786 {
787 int i;
788
789 for (i = 0; i <= AvFILLp (c->on_enter_xs); i += 2)
790 ((coro_enterleave_hook)AvARRAY (c->on_enter_xs)[i]) (aTHX_ AvARRAY (c->on_enter_xs)[i + 1]);
791 }
792
774 SWAP_SVS (c); 793 SWAP_SVS (c);
775} 794}
776 795
777static void 796static void
778save_perl (pTHX_ Coro__State c) 797save_perl (pTHX_ Coro__State c)
779{ 798{
780 SWAP_SVS (c); 799 SWAP_SVS (c);
800
801 if (ecb_expect_false (c->on_leave_xs))
802 {
803 int i;
804
805 for (i = AvFILLp (c->on_leave_xs) - 1; i >= 0; i -= 2)
806 ((coro_enterleave_hook)AvARRAY (c->on_leave_xs)[i]) (aTHX_ AvARRAY (c->on_leave_xs)[i + 1]);
807 }
781 808
782 if (ecb_expect_false (c->on_leave)) 809 if (ecb_expect_false (c->on_leave))
783 { 810 {
784 int i; 811 int i;
785 812
1138 1165
1139 GvSV (PL_defgv) = newSV (0); 1166 GvSV (PL_defgv) = newSV (0);
1140 GvAV (PL_defgv) = coro->args; coro->args = 0; 1167 GvAV (PL_defgv) = coro->args; coro->args = 0;
1141 GvSV (PL_errgv) = newSV (0); 1168 GvSV (PL_errgv) = newSV (0);
1142 GvSV (irsgv) = newSVpvn ("\n", 1); sv_magic (GvSV (irsgv), (SV *)irsgv, PERL_MAGIC_sv, "/", 0); 1169 GvSV (irsgv) = newSVpvn ("\n", 1); sv_magic (GvSV (irsgv), (SV *)irsgv, PERL_MAGIC_sv, "/", 0);
1143 GvHV (PL_hintgv) = 0; 1170 GvHV (PL_hintgv) = newHV ();
1171#if PERL_VERSION_ATLEAST (5,10,0)
1172 hv_magic (GvHV (PL_hintgv), 0, PERL_MAGIC_hints);
1173#endif
1144 PL_rs = newSVsv (GvSV (irsgv)); 1174 PL_rs = newSVsv (GvSV (irsgv));
1145 PL_defoutgv = (GV *)SvREFCNT_inc_NN (stdoutgv); 1175 PL_defoutgv = (GV *)SvREFCNT_inc_NN (stdoutgv);
1146 1176
1147 { 1177 {
1148 dSP; 1178 dSP;
1258 1288
1259 SvREFCNT_dec (coro->saved_deffh); 1289 SvREFCNT_dec (coro->saved_deffh);
1260 SvREFCNT_dec (coro->rouse_cb); 1290 SvREFCNT_dec (coro->rouse_cb);
1261 SvREFCNT_dec (coro->invoke_cb); 1291 SvREFCNT_dec (coro->invoke_cb);
1262 SvREFCNT_dec (coro->invoke_av); 1292 SvREFCNT_dec (coro->invoke_av);
1293 SvREFCNT_dec (coro->on_enter_xs);
1294 SvREFCNT_dec (coro->on_leave_xs);
1263 } 1295 }
1264} 1296}
1265 1297
1266ecb_inline void 1298ecb_inline void
1267free_coro_mortal (pTHX) 1299free_coro_mortal (pTHX)
1330 1362
1331 if (PL_curcop != &PL_compiling) 1363 if (PL_curcop != &PL_compiling)
1332 { 1364 {
1333 SV **cb; 1365 SV **cb;
1334 1366
1335 if (oldcxix != cxstack_ix && cctx_current->flags & CC_TRACE_SUB) 1367 if (oldcxix != cxstack_ix && cctx_current->flags & CC_TRACE_SUB && cxstack_ix >= 0)
1336 { 1368 {
1337 PERL_CONTEXT *cx = &cxstack[cxstack_ix]; 1369 PERL_CONTEXT *cx = &cxstack[cxstack_ix];
1338 1370
1339 if (CxTYPE (cx) == CXt_SUB && oldcxix < cxstack_ix) 1371 if (CxTYPE (cx) == CXt_SUB && oldcxix < cxstack_ix)
1340 { 1372 {
1927 1959
1928 ENTER; 1960 ENTER;
1929 SAVETMPS; 1961 SAVETMPS;
1930 1962
1931 PUSHMARK (SP); 1963 PUSHMARK (SP);
1932 XPUSHs (sv_2mortal (newSVpv ("FATAL: $Coro::IDLE blocked itself - did you try to block inside an event loop callback? Caught", 0))); 1964 XPUSHs (sv_2mortal (newSVpv ("FATAL: $Coro::idle blocked itself - did you try to block inside an event loop callback? Caught", 0)));
1933 PUTBACK; 1965 PUTBACK;
1934 call_pv ("Carp::confess", G_VOID | G_DISCARD); 1966 call_pv ("Carp::confess", G_VOID | G_DISCARD);
1935 1967
1936 FREETMPS; 1968 FREETMPS;
1937 LEAVE; 1969 LEAVE;
2248 slf_init_terminate_cancel_common (aTHX_ frame, coro_hv); 2280 slf_init_terminate_cancel_common (aTHX_ frame, coro_hv);
2249 } 2281 }
2250 else 2282 else
2251 { 2283 {
2252 struct coro *self = SvSTATE_current; 2284 struct coro *self = SvSTATE_current;
2285
2286 if (!self)
2287 croak ("Coro::cancel called outside of thread content,");
2253 2288
2254 /* otherwise we cancel directly, purely for speed reasons 2289 /* otherwise we cancel directly, purely for speed reasons
2255 * unfortunately, this requires some magic trickery, as 2290 * unfortunately, this requires some magic trickery, as
2256 * somebody else could cancel us, so we have to fight the cancellation. 2291 * somebody else could cancel us, so we have to fight the cancellation.
2257 * this is ugly, and hopefully fully worth the extra speed. 2292 * this is ugly, and hopefully fully worth the extra speed.
2599 2634
2600/* "undo"/cancel a running slf call - used when cancelling a coro, mainly */ 2635/* "undo"/cancel a running slf call - used when cancelling a coro, mainly */
2601static void 2636static void
2602slf_destroy (pTHX_ struct coro *coro) 2637slf_destroy (pTHX_ struct coro *coro)
2603{ 2638{
2604 /* this callback is reserved for slf functions needing to do cleanup */ 2639 struct CoroSLF frame = coro->slf_frame;
2605 if (coro->slf_frame.destroy && coro->slf_frame.prepare && !PL_dirty)
2606 coro->slf_frame.destroy (aTHX_ &coro->slf_frame);
2607 2640
2608 /* 2641 /*
2609 * The on_destroy above most likely is from an SLF call. 2642 * The on_destroy below most likely is from an SLF call.
2610 * Since by definition the SLF call will not finish when we destroy 2643 * Since by definition the SLF call will not finish when we destroy
2611 * the coro, we will have to force-finish it here, otherwise 2644 * the coro, we will have to force-finish it here, otherwise
2612 * cleanup functions cannot call SLF functions. 2645 * cleanup functions cannot call SLF functions.
2613 */ 2646 */
2614 coro->slf_frame.prepare = 0; 2647 coro->slf_frame.prepare = 0;
2648
2649 /* this callback is reserved for slf functions needing to do cleanup */
2650 if (frame.destroy && frame.prepare && !PL_dirty)
2651 frame.destroy (aTHX_ &frame);
2615} 2652}
2616 2653
2617/* 2654/*
2618 * these not obviously related functions are all rolled into one 2655 * these not obviously related functions are all rolled into one
2619 * function to increase chances that they all will call transfer with the same 2656 * function to increase chances that they all will call transfer with the same
2802static void 2839static void
2803coro_pop_on_leave (pTHX_ void *coro) 2840coro_pop_on_leave (pTHX_ void *coro)
2804{ 2841{
2805 SV *cb = coro_avp_pop_and_free (aTHX_ &((struct coro *)coro)->on_leave); 2842 SV *cb = coro_avp_pop_and_free (aTHX_ &((struct coro *)coro)->on_leave);
2806 on_enterleave_call (aTHX_ sv_2mortal (cb)); 2843 on_enterleave_call (aTHX_ sv_2mortal (cb));
2844}
2845
2846static void
2847enterleave_hook_xs (pTHX_ struct coro *coro, AV **avp, coro_enterleave_hook hook, void *arg)
2848{
2849 if (!hook)
2850 return;
2851
2852 if (!*avp)
2853 {
2854 *avp = newAV ();
2855 AvREAL_off (*avp);
2856 }
2857
2858 av_push (*avp, (SV *)hook);
2859 av_push (*avp, (SV *)arg);
2860}
2861
2862static void
2863enterleave_unhook_xs (pTHX_ struct coro *coro, AV **avp, coro_enterleave_hook hook, int execute)
2864{
2865 AV *av = *avp;
2866 int i;
2867
2868 if (!av)
2869 return;
2870
2871 for (i = AvFILLp (av) - 1; i >= 0; i -= 2)
2872 if (AvARRAY (av)[i] == (SV *)hook)
2873 {
2874 if (execute)
2875 hook ((void *)AvARRAY (av)[i + 1]);
2876
2877 memmove (AvARRAY (av) + i, AvARRAY (av) + i + 2, AvFILLp (av) - i - 1);
2878 av_pop (av);
2879 av_pop (av);
2880 break;
2881 }
2882
2883 if (AvFILLp (av) >= 0)
2884 {
2885 *avp = 0;
2886 SvREFCNT_dec_NN (av);
2887 }
2888}
2889
2890static void
2891api_enterleave_hook (pTHX_ SV *coro_sv, coro_enterleave_hook enter, void *enter_arg, coro_enterleave_hook leave, void *leave_arg)
2892{
2893 struct coro *coro = SvSTATE (coro_sv);
2894
2895 if (SvSTATE_current == coro)
2896 if (enter)
2897 enter (aTHX enter_arg);
2898
2899 enterleave_hook_xs (aTHX_ coro, &coro->on_enter_xs, enter, enter_arg);
2900 enterleave_hook_xs (aTHX_ coro, &coro->on_leave_xs, leave, leave_arg);
2901}
2902
2903static void
2904api_enterleave_unhook (pTHX_ SV *coro_sv, coro_enterleave_hook enter, coro_enterleave_hook leave)
2905{
2906 struct coro *coro = SvSTATE (coro_sv);
2907
2908 enterleave_unhook_xs (aTHX_ coro, &coro->on_enter_xs, enter, 0);
2909 enterleave_unhook_xs (aTHX_ coro, &coro->on_leave_xs, leave, SvSTATE_current == coro);
2910}
2911
2912static void
2913savedestructor_unhook_enter (pTHX_ coro_enterleave_hook enter)
2914{
2915 struct coro *coro = SvSTATE_current;
2916
2917 enterleave_unhook_xs (aTHX_ coro, &coro->on_enter_xs, enter, 0);
2918}
2919
2920static void
2921savedestructor_unhook_leave (pTHX_ coro_enterleave_hook leave)
2922{
2923 struct coro *coro = SvSTATE_current;
2924
2925 enterleave_unhook_xs (aTHX_ coro, &coro->on_leave_xs, leave, 1);
2926}
2927
2928static void
2929api_enterleave_scope_hook (pTHX_ coro_enterleave_hook enter, void *enter_arg, coro_enterleave_hook leave, void *leave_arg)
2930{
2931 api_enterleave_hook (aTHX_ coro_current, enter, enter_arg, leave, leave_arg);
2932
2933 /* this ought to be much cheaper than malloc + a single destructor call */
2934 if (enter) SAVEDESTRUCTOR_X (savedestructor_unhook_enter, enter);
2935 if (leave) SAVEDESTRUCTOR_X (savedestructor_unhook_leave, leave);
2807} 2936}
2808 2937
2809/*****************************************************************************/ 2938/*****************************************************************************/
2810/* PerlIO::cede */ 2939/* PerlIO::cede */
2811 2940
2941 XPUSHs (sv_2mortal (newRV_inc ((SV *)av))); 3070 XPUSHs (sv_2mortal (newRV_inc ((SV *)av)));
2942 PUTBACK; 3071 PUTBACK;
2943 call_sv (cb, G_VOID | G_DISCARD | G_EVAL | G_KEEPERR); 3072 call_sv (cb, G_VOID | G_DISCARD | G_EVAL | G_KEEPERR);
2944 } 3073 }
2945 3074
2946 SvREFCNT_dec (cb); 3075 SvREFCNT_dec_NN (cb);
2947 } 3076 }
2948} 3077}
2949 3078
2950static void 3079static void
2951coro_semaphore_destroy (pTHX_ struct CoroSLF *frame) 3080coro_semaphore_destroy (pTHX_ struct CoroSLF *frame)
2959{ 3088{
2960 AV *av = (AV *)frame->data; 3089 AV *av = (AV *)frame->data;
2961 SV *count_sv = AvARRAY (av)[0]; 3090 SV *count_sv = AvARRAY (av)[0];
2962 SV *coro_hv = SvRV (coro_current); 3091 SV *coro_hv = SvRV (coro_current);
2963 3092
3093 frame->destroy = 0;
3094
2964 /* if we are about to throw, don't actually acquire the lock, just throw */ 3095 /* if we are about to throw, don't actually acquire the lock, just throw */
2965 if (CORO_THROW) 3096 if (ecb_expect_false (CORO_THROW))
3097 {
3098 /* we still might be responsible for the semaphore, so wake up others */
3099 coro_semaphore_adjust (aTHX_ av, 0);
3100
2966 return 0; 3101 return 0;
3102 }
2967 else if (SvIVX (count_sv) > 0) 3103 else if (SvIVX (count_sv) > 0)
2968 { 3104 {
2969 frame->destroy = 0;
2970
2971 if (acquire) 3105 if (acquire)
2972 SvIVX (count_sv) = SvIVX (count_sv) - 1; 3106 SvIVX (count_sv) = SvIVX (count_sv) - 1;
2973 else 3107 else
2974 coro_semaphore_adjust (aTHX_ av, 0); 3108 coro_semaphore_adjust (aTHX_ av, 0);
2975 3109
3086 { 3220 {
3087 api_ready (aTHX_ cb); 3221 api_ready (aTHX_ cb);
3088 sv_setiv (cb, 0); /* signal waiter */ 3222 sv_setiv (cb, 0); /* signal waiter */
3089 } 3223 }
3090 3224
3091 SvREFCNT_dec (cb); 3225 SvREFCNT_dec_NN (cb);
3092 3226
3093 --count; 3227 --count;
3094 } 3228 }
3095} 3229}
3096 3230
3181 } 3315 }
3182 3316
3183 av_push (state, data_sv); 3317 av_push (state, data_sv);
3184 3318
3185 api_ready (aTHX_ coro); 3319 api_ready (aTHX_ coro);
3186 SvREFCNT_dec (coro); 3320 SvREFCNT_dec_NN (coro);
3187 SvREFCNT_dec ((AV *)state); 3321 SvREFCNT_dec_NN ((AV *)state);
3188} 3322}
3189 3323
3190static int 3324static int
3191slf_check_aio_req (pTHX_ struct CoroSLF *frame) 3325slf_check_aio_req (pTHX_ struct CoroSLF *frame)
3192{ 3326{
3210 errno = data->errorno; 3344 errno = data->errorno;
3211 PL_laststype = data->laststype; 3345 PL_laststype = data->laststype;
3212 PL_laststatval = data->laststatval; 3346 PL_laststatval = data->laststatval;
3213 PL_statcache = data->statcache; 3347 PL_statcache = data->statcache;
3214 3348
3215 SvREFCNT_dec (data_sv); 3349 SvREFCNT_dec_NN (data_sv);
3216 } 3350 }
3217 3351
3218 /* push result values */ 3352 /* push result values */
3219 { 3353 {
3220 dSP; 3354 dSP;
3435 3569
3436PROTOTYPES: DISABLE 3570PROTOTYPES: DISABLE
3437 3571
3438BOOT: 3572BOOT:
3439{ 3573{
3574#define VARx(name,expr,type) if (sizeof (type) < sizeof (expr)) croak ("FATAL: Coro thread context slot '" # name "' too small for this version of perl.");
3575#include "state.h"
3440#ifdef USE_ITHREADS 3576#ifdef USE_ITHREADS
3441# if CORO_PTHREAD 3577# if CORO_PTHREAD
3442 coro_thx = PERL_GET_CONTEXT; 3578 coro_thx = PERL_GET_CONTEXT;
3443# endif 3579# endif
3444#endif 3580#endif
3830 coroapi.ready = api_ready; 3966 coroapi.ready = api_ready;
3831 coroapi.is_ready = api_is_ready; 3967 coroapi.is_ready = api_is_ready;
3832 coroapi.nready = coro_nready; 3968 coroapi.nready = coro_nready;
3833 coroapi.current = coro_current; 3969 coroapi.current = coro_current;
3834 3970
3971 coroapi.enterleave_hook = api_enterleave_hook;
3972 coroapi.enterleave_unhook = api_enterleave_unhook;
3973 coroapi.enterleave_scope_hook = api_enterleave_scope_hook;
3974
3835 /*GCoroAPI = &coroapi;*/ 3975 /*GCoroAPI = &coroapi;*/
3836 sv_setiv (sv, (IV)&coroapi); 3976 sv_setiv (sv, (IV)&coroapi);
3837 SvREADONLY_on (sv); 3977 SvREADONLY_on (sv);
3838 } 3978 }
3839} 3979}
3904 4044
3905void 4045void
3906_set_current (SV *current) 4046_set_current (SV *current)
3907 PROTOTYPE: $ 4047 PROTOTYPE: $
3908 CODE: 4048 CODE:
3909 SvREFCNT_dec (SvRV (coro_current)); 4049 SvREFCNT_dec_NN (SvRV (coro_current));
3910 SvRV_set (coro_current, SvREFCNT_inc_NN (SvRV (current))); 4050 SvRV_set (coro_current, SvREFCNT_inc_NN (SvRV (current)));
3911 4051
3912void 4052void
3913_set_readyhook (SV *hook) 4053_set_readyhook (SV *hook)
3914 PROTOTYPE: $ 4054 PROTOTYPE: $
3998 4138
3999 if ((SV *)hv == &PL_sv_undef) 4139 if ((SV *)hv == &PL_sv_undef)
4000 { 4140 {
4001 SV *sv = coro_new (aTHX_ coro_stash, (SV **)&cv_pool_handler, 1, 1); 4141 SV *sv = coro_new (aTHX_ coro_stash, (SV **)&cv_pool_handler, 1, 1);
4002 hv = (HV *)SvREFCNT_inc_NN (SvRV (sv)); 4142 hv = (HV *)SvREFCNT_inc_NN (SvRV (sv));
4003 SvREFCNT_dec (sv); 4143 SvREFCNT_dec_NN (sv);
4004 } 4144 }
4005 4145
4006 { 4146 {
4007 struct coro *coro = SvSTATE_hv (hv); 4147 struct coro *coro = SvSTATE_hv (hv);
4008 4148
4015 api_ready (aTHX_ (SV *)hv); 4155 api_ready (aTHX_ (SV *)hv);
4016 4156
4017 if (GIMME_V != G_VOID) 4157 if (GIMME_V != G_VOID)
4018 XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv))); 4158 XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv)));
4019 else 4159 else
4020 SvREFCNT_dec (hv); 4160 SvREFCNT_dec_NN (hv);
4021} 4161}
4022 4162
4023SV * 4163SV *
4024rouse_cb () 4164rouse_cb ()
4025 PROTOTYPE: 4165 PROTOTYPE:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines