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.467 by root, Sun Jun 26 21:46:03 2016 UTC vs.
Revision 1.471 by root, Fri Jul 14 23:20:07 2017 UTC

116# define CORO_CLOCK_MONOTONIC 1 116# define CORO_CLOCK_MONOTONIC 1
117# define CORO_CLOCK_THREAD_CPUTIME_ID 3 117# define CORO_CLOCK_THREAD_CPUTIME_ID 3
118# endif 118# endif
119#endif 119#endif
120 120
121/* one off bugfix for perl 5.22 */
122#if PERL_VERSION_ATLEAST(5,22,0) && !PERL_VERSION_ATLEAST(5,24,0)
123# undef PadlistNAMES
124# define PadlistNAMES(pl) *((PADNAMELIST **)PadlistARRAY (pl))
125#endif
126
127#if PERL_VERSION_ATLEAST(5,24,0)
128# define SUB_ARGARRAY PL_curpad[0]
129#else
130# define SUB_ARGARRAY (SV *)cx->blk_sub.argarray
131#endif
132
121/* perl usually suppressed asserts. for debugging, we sometimes force it to be on */ 133/* perl usually suppresses asserts. for debugging, we sometimes force it to be on */
122#if 0 134#if 0
123# undef NDEBUG 135# undef NDEBUG
124# include <assert.h> 136# include <assert.h>
125#endif 137#endif
126 138
1410 SAVETMPS; 1422 SAVETMPS;
1411 EXTEND (SP, 3); 1423 EXTEND (SP, 3);
1412 PUSHMARK (SP); 1424 PUSHMARK (SP);
1413 PUSHs (&PL_sv_yes); 1425 PUSHs (&PL_sv_yes);
1414 PUSHs (fullname); 1426 PUSHs (fullname);
1415 PUSHs (CxHASARGS (cx) ? sv_2mortal (newRV_inc ((SV *)cx->blk_sub.argarray)) : &PL_sv_undef); 1427 PUSHs (CxHASARGS (cx) ? sv_2mortal (newRV_inc (SUB_ARGARRAY)) : &PL_sv_undef);
1416 PUTBACK; 1428 PUTBACK;
1417 cb = hv_fetch ((HV *)SvRV (coro_current), "_trace_sub_cb", sizeof ("_trace_sub_cb") - 1, 0); 1429 cb = hv_fetch ((HV *)SvRV (coro_current), "_trace_sub_cb", sizeof ("_trace_sub_cb") - 1, 0);
1418 if (cb) call_sv (*cb, G_KEEPERR | G_EVAL | G_VOID | G_DISCARD); 1430 if (cb) call_sv (*cb, G_KEEPERR | G_EVAL | G_VOID | G_DISCARD);
1419 SPAGAIN; 1431 SPAGAIN;
1420 FREETMPS; 1432 FREETMPS;
3585 3597
3586 map_len = load_len + save_len + 16; 3598 map_len = load_len + save_len + 16;
3587 3599
3588 map_base = mmap (0, map_len, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); 3600 map_base = mmap (0, map_len, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
3589 3601
3602 if (map_base == (char *)MAP_FAILED)
3603 map_base = mmap (0, map_len, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
3604
3590 assert (("Coro: unable to mmap jit code page, cannot continue.", map_base != (char *)MAP_FAILED)); 3605 assert (("Coro: unable to mmap jit code page, cannot continue.", map_base != (char *)MAP_FAILED));
3591 3606
3592 load_perl_slots = (load_save_perl_slots_type)map_base; 3607 load_perl_slots = (load_save_perl_slots_type)map_base;
3593 memcpy (map_base, load_ptr, load_len); 3608 memcpy (map_base, load_ptr, load_len);
3594 3609
4064 coroapi.enterleave_hook = api_enterleave_hook; 4079 coroapi.enterleave_hook = api_enterleave_hook;
4065 coroapi.enterleave_unhook = api_enterleave_unhook; 4080 coroapi.enterleave_unhook = api_enterleave_unhook;
4066 coroapi.enterleave_scope_hook = api_enterleave_scope_hook; 4081 coroapi.enterleave_scope_hook = api_enterleave_scope_hook;
4067 4082
4068 /*GCoroAPI = &coroapi;*/ 4083 /*GCoroAPI = &coroapi;*/
4069 sv_setiv (sv, (IV)&coroapi); 4084 sv_setiv (sv, PTR2IV (&coroapi));
4070 SvREADONLY_on (sv); 4085 SvREADONLY_on (sv);
4071 } 4086 }
4072} 4087}
4073 4088
4074SV * 4089SV *

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines