… | |
… | |
715 | prev__cctx = prev->cctx; |
715 | prev__cctx = prev->cctx; |
716 | |
716 | |
717 | /* possibly "free" the cctx */ |
717 | /* possibly "free" the cctx */ |
718 | if (prev__cctx->idle_sp == STACKLEVEL) |
718 | if (prev__cctx->idle_sp == STACKLEVEL) |
719 | { |
719 | { |
|
|
720 | /* I assume that STACKLEVEL is a stronger indicator than PL_top_env changes */ |
720 | assert (PL_top_env == prev__cctx->top_env); |
721 | assert (PL_top_env == prev__cctx->top_env); |
721 | |
722 | |
722 | cctx_put (prev__cctx); |
723 | cctx_put (prev__cctx); |
723 | prev->cctx = 0; |
724 | prev->cctx = 0; |
724 | } |
725 | } |
725 | else if (prev__cctx->idle_sp) //D |
|
|
726 | fprintf (stderr, "coro %p has own stack %p-%p\n", prev__cctx, prev__cctx->idle_sp, STACKLEVEL);//D |
|
|
727 | |
726 | |
728 | if (!next->cctx) |
727 | if (!next->cctx) |
729 | next->cctx = cctx_get (); |
728 | next->cctx = cctx_get (); |
730 | |
729 | |
731 | if (prev__cctx != next->cctx) |
730 | if (prev__cctx != next->cctx) |