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.28 by root, Sat Aug 25 21:32:05 2001 UTC vs.
Revision 1.29 by root, Sat Aug 25 21:40:34 2001 UTC

563 563
564 ctx->stack = 0; 564 ctx->stack = 0;
565 565
566 if (stack) 566 if (stack)
567 { 567 {
568 printf ("deallocating stack %p %d\n", stack, stack->refcnt);/*D*/
569 if (!--stack->refcnt) 568 if (!--stack->refcnt)
570 { 569 {
571#ifdef HAVE_MMAP 570#ifdef HAVE_MMAP
572 if (stack->ssize > 0 && stack->sptr) 571 if (stack->ssize > 0 && stack->sptr)
573 munmap (stack->sptr, stack->ssize); 572 munmap (stack->sptr, stack->ssize);
660transfer(pTHX_ struct coro *prev, struct coro *next, int flags) 659transfer(pTHX_ struct coro *prev, struct coro *next, int flags)
661{ 660{
662 dSTACKLEVEL; 661 dSTACKLEVEL;
663 static struct coro *xnext; 662 static struct coro *xnext;
664 663
665 printf ("%p => %p\n", prev, next);/*D*/
666 if (prev != next) 664 if (prev != next)
667 { 665 {
668 xnext = next; 666 xnext = next;
669 667
670 if (next->mainstack) 668 if (next->mainstack)
736 else 734 else
737 setup_coro (next); 735 setup_coro (next);
738 } 736 }
739 } 737 }
740 738
739 /*
740 * xnext is now either prev or next, depending on wether
741 * we switched the c stack or not. that's why i use a global
742 * variable, that should become thread-specific at one point.
743 */
741 xnext->cursp = stacklevel; 744 xnext->cursp = stacklevel;
742} 745}
743 746
744static struct coro * 747static struct coro *
745sv_to_coro (SV *arg, const char *funcname, const char *varname) 748sv_to_coro (SV *arg, const char *funcname, const char *varname)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines