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.75 by root, Thu Oct 26 06:50:20 2006 UTC vs.
Revision 1.76 by root, Thu Oct 26 08:45:56 2006 UTC

28# define IS_PADCONST(v) 0 28# define IS_PADCONST(v) 0
29# endif 29# endif
30#endif 30#endif
31 31
32#include <errno.h> 32#include <errno.h>
33#include <signal.h>
34 33
35#ifdef HAVE_MMAP 34#ifdef HAVE_MMAP
36# include <unistd.h> 35# include <unistd.h>
37# include <sys/mman.h> 36# include <sys/mman.h>
38# ifndef MAP_ANONYMOUS 37# ifndef MAP_ANONYMOUS
275 /* casting is fun. */ 274 /* casting is fun. */
276 while (&PL_sv_undef != (SV *)(padlist = (AV *)av_pop (av))) 275 while (&PL_sv_undef != (SV *)(padlist = (AV *)av_pop (av)))
277 free_padlist (aTHX_ padlist); 276 free_padlist (aTHX_ padlist);
278 277
279 SvREFCNT_dec (av); 278 SvREFCNT_dec (av);
279
280 return 0;
280} 281}
281 282
282#define PERL_MAGIC_coro PERL_MAGIC_ext 283#define PERL_MAGIC_coro PERL_MAGIC_ext
283 284
284static MGVTBL vtbl_coro = {0, 0, 0, 0, coro_cv_free}; 285static MGVTBL vtbl_coro = {0, 0, 0, 0, coro_cv_free};
603 stack->ssize = STACKSIZE * sizeof (long); /* mmap should do allocate-on-write for us */ 604 stack->ssize = STACKSIZE * sizeof (long); /* mmap should do allocate-on-write for us */
604 stack->sptr = mmap (0, stack->ssize, PROT_EXEC|PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0); 605 stack->sptr = mmap (0, stack->ssize, PROT_EXEC|PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0);
605 if (stack->sptr == (void *)-1) 606 if (stack->sptr == (void *)-1)
606#endif 607#endif
607 { 608 {
608 /*FIXME*//*D*//* reasonable stack size! */
609 stack->ssize = - (STACKSIZE * sizeof (long)); 609 stack->ssize = - (STACKSIZE * (long)sizeof (long));
610 New (0, stack->sptr, STACKSIZE, long); 610 New (0, stack->sptr, STACKSIZE, long);
611 } 611 }
612 } 612 }
613 else 613 else
614 stack->sptr = 0; 614 stack->sptr = 0;
706 /* 706 /*
707 * this is a _very_ stripped down perl interpreter ;) 707 * this is a _very_ stripped down perl interpreter ;)
708 */ 708 */
709 dTHX; 709 dTHX;
710 Coro__State ctx = (Coro__State)arg; 710 Coro__State ctx = (Coro__State)arg;
711 JMPENV coro_start_env;
712 711
713 PL_top_env = &ctx->start_env; 712 PL_top_env = &ctx->start_env;
714 713
715 ctx->cursp = 0; 714 ctx->cursp = 0;
716 PL_op = PL_op->op_next; 715 PL_op = PL_op->op_next;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines