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.288 by root, Mon Nov 17 07:14:50 2008 UTC vs.
Revision 1.289 by root, Mon Nov 17 08:25:06 2008 UTC

2776new (SV *klass, SV *count_ = 0) 2776new (SV *klass, SV *count_ = 0)
2777 CODE: 2777 CODE:
2778{ 2778{
2779 /* a semaphore contains a counter IV in $sem->[0] and any waiters after that */ 2779 /* a semaphore contains a counter IV in $sem->[0] and any waiters after that */
2780 AV *av = newAV (); 2780 AV *av = newAV ();
2781 SV **ary;
2782
2783 /* unfortunately, building manually saves memory */
2784 Newx (ary, 2, SV *);
2785 AvALLOC (av) = ary;
2786 AvARRAY (av) = ary;
2787 AvMAX (av) = 1;
2788 AvFILLp (av) = 0;
2781 av_push (av, newSViv (count_ && SvOK (count_) ? SvIV (count_) : 1)); 2789 ary [0] = newSViv (count_ && SvOK (count_) ? SvIV (count_) : 1);
2790
2782 RETVAL = sv_bless (newRV_noinc ((SV *)av), GvSTASH (CvGV (cv))); 2791 RETVAL = sv_bless (newRV_noinc ((SV *)av), GvSTASH (CvGV (cv)));
2783} 2792}
2784 OUTPUT: 2793 OUTPUT:
2785 RETVAL 2794 RETVAL
2786 2795

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines