… | |
… | |
260 | static struct coro *coro_first; |
260 | static struct coro *coro_first; |
261 | |
261 | |
262 | /** lowlevel stuff **********************************************************/ |
262 | /** lowlevel stuff **********************************************************/ |
263 | |
263 | |
264 | static SV * |
264 | static SV * |
265 | coro_get_sv (const char *name, int create) |
265 | coro_get_sv (pTHX_ const char *name, int create) |
266 | { |
266 | { |
267 | #if PERL_VERSION_ATLEAST (5,9,0) |
267 | #if PERL_VERSION_ATLEAST (5,9,0) |
268 | /* silence stupid and wrong 5.10 warning that I am unable to switch off */ |
268 | /* silence stupid and wrong 5.10 warning that I am unable to switch off */ |
269 | get_sv (name, create); |
269 | get_sv (name, create); |
270 | #endif |
270 | #endif |
271 | return get_sv (name, create); |
271 | return get_sv (name, create); |
272 | } |
272 | } |
273 | |
273 | |
274 | static AV * |
274 | static AV * |
275 | coro_get_av (const char *name, int create) |
275 | coro_get_av (pTHX_ const char *name, int create) |
276 | { |
276 | { |
277 | #if PERL_VERSION_ATLEAST (5,9,0) |
277 | #if PERL_VERSION_ATLEAST (5,9,0) |
278 | /* silence stupid and wrong 5.10 warning that I am unable to switch off */ |
278 | /* silence stupid and wrong 5.10 warning that I am unable to switch off */ |
279 | get_av (name, create); |
279 | get_av (name, create); |
280 | #endif |
280 | #endif |
281 | return get_av (name, create); |
281 | return get_av (name, create); |
282 | } |
282 | } |
283 | |
283 | |
284 | static HV * |
284 | static HV * |
285 | coro_get_hv (const char *name, int create) |
285 | coro_get_hv (pTHX_ const char *name, int create) |
286 | { |
286 | { |
287 | #if PERL_VERSION_ATLEAST (5,9,0) |
287 | #if PERL_VERSION_ATLEAST (5,9,0) |
288 | /* silence stupid and wrong 5.10 warning that I am unable to switch off */ |
288 | /* silence stupid and wrong 5.10 warning that I am unable to switch off */ |
289 | get_hv (name, create); |
289 | get_hv (name, create); |
290 | #endif |
290 | #endif |
… | |
… | |
1506 | BOOT_PAGESIZE; |
1506 | BOOT_PAGESIZE; |
1507 | |
1507 | |
1508 | irsgv = gv_fetchpv ("/" , GV_ADD|GV_NOTQUAL, SVt_PV); |
1508 | irsgv = gv_fetchpv ("/" , GV_ADD|GV_NOTQUAL, SVt_PV); |
1509 | stdoutgv = gv_fetchpv ("STDOUT", GV_ADD|GV_NOTQUAL, SVt_PVIO); |
1509 | stdoutgv = gv_fetchpv ("STDOUT", GV_ADD|GV_NOTQUAL, SVt_PVIO); |
1510 | |
1510 | |
1511 | hv_sig = coro_get_hv ("SIG", TRUE); |
1511 | hv_sig = coro_get_hv (aTHX_ "SIG", TRUE); |
1512 | sv_diehook = coro_get_sv ("Coro::State::DIEHOOK" , TRUE); |
1512 | sv_diehook = coro_get_sv (aTHX_ "Coro::State::DIEHOOK" , TRUE); |
1513 | sv_warnhook = coro_get_sv ("Coro::State::WARNHOOK", TRUE); |
1513 | sv_warnhook = coro_get_sv (aTHX_ "Coro::State::WARNHOOK", TRUE); |
1514 | |
1514 | |
1515 | if (!PL_diehook ) hv_store (hv_sig, "__DIE__" , sizeof ("__DIE__" ) - 1, SvREFCNT_inc (sv_diehook ), 0); |
1515 | if (!PL_diehook ) hv_store (hv_sig, "__DIE__" , sizeof ("__DIE__" ) - 1, SvREFCNT_inc (sv_diehook ), 0); |
1516 | if (!PL_warnhook) hv_store (hv_sig, "__WARN__", sizeof ("__WARN__") - 1, SvREFCNT_inc (sv_warnhook), 0); |
1516 | if (!PL_warnhook) hv_store (hv_sig, "__WARN__", sizeof ("__WARN__") - 1, SvREFCNT_inc (sv_warnhook), 0); |
1517 | |
1517 | |
1518 | coro_state_stash = gv_stashpv ("Coro::State", TRUE); |
1518 | coro_state_stash = gv_stashpv ("Coro::State", TRUE); |
… | |
… | |
1754 | |
1754 | |
1755 | BOOT: |
1755 | BOOT: |
1756 | { |
1756 | { |
1757 | int i; |
1757 | int i; |
1758 | |
1758 | |
1759 | sv_pool_rss = coro_get_sv ("Coro::POOL_RSS" , TRUE); |
1759 | sv_pool_rss = coro_get_sv (aTHX_ "Coro::POOL_RSS" , TRUE); |
1760 | sv_pool_size = coro_get_sv ("Coro::POOL_SIZE" , TRUE); |
1760 | sv_pool_size = coro_get_sv (aTHX_ "Coro::POOL_SIZE" , TRUE); |
1761 | av_async_pool = coro_get_av ("Coro::async_pool", TRUE); |
1761 | av_async_pool = coro_get_av (aTHX_ "Coro::async_pool", TRUE); |
1762 | |
1762 | |
1763 | coro_current = coro_get_sv ("Coro::current", FALSE); |
1763 | coro_current = coro_get_sv (aTHX_ "Coro::current", FALSE); |
1764 | SvREADONLY_on (coro_current); |
1764 | SvREADONLY_on (coro_current); |
1765 | |
1765 | |
1766 | coro_stash = gv_stashpv ("Coro", TRUE); |
1766 | coro_stash = gv_stashpv ("Coro", TRUE); |
1767 | |
1767 | |
1768 | newCONSTSUB (coro_stash, "PRIO_MAX", newSViv (PRIO_MAX)); |
1768 | newCONSTSUB (coro_stash, "PRIO_MAX", newSViv (PRIO_MAX)); |