… | |
… | |
1178 | /* |
1178 | /* |
1179 | * If perl-run returns we assume exit() was being called or the coro |
1179 | * If perl-run returns we assume exit() was being called or the coro |
1180 | * fell off the end, which seems to be the only valid (non-bug) |
1180 | * fell off the end, which seems to be the only valid (non-bug) |
1181 | * reason for perl_run to return. We try to exit by jumping to the |
1181 | * reason for perl_run to return. We try to exit by jumping to the |
1182 | * bootstrap-time "top" top_env, as we cannot restore the "main" |
1182 | * bootstrap-time "top" top_env, as we cannot restore the "main" |
1183 | * coroutine as Coro has no such concept |
1183 | * coroutine as Coro has no such concept. |
|
|
1184 | * This actually isn't valid with the pthread backend, but OSes requiring |
|
|
1185 | * that backend are too broken to do it in a standards-compliant way. |
1184 | */ |
1186 | */ |
1185 | PL_top_env = main_top_env; |
1187 | PL_top_env = main_top_env; |
1186 | JMPENV_JUMP (2); /* I do not feel well about the hardcoded 2 at all */ |
1188 | JMPENV_JUMP (2); /* I do not feel well about the hardcoded 2 at all */ |
1187 | } |
1189 | } |
1188 | } |
1190 | } |
… | |
… | |
2368 | SV **ary; |
2370 | SV **ary; |
2369 | |
2371 | |
2370 | /* unfortunately, building manually saves memory */ |
2372 | /* unfortunately, building manually saves memory */ |
2371 | Newx (ary, 2, SV *); |
2373 | Newx (ary, 2, SV *); |
2372 | AvALLOC (av) = ary; |
2374 | AvALLOC (av) = ary; |
|
|
2375 | #if PERL_VERSION_ATLEAST (5,10,0) |
2373 | /*AvARRAY (av) = ary;*/ |
2376 | AvARRAY (av) = ary; |
|
|
2377 | #else |
2374 | SvPVX ((SV *)av) = (char *)ary; /* 5.8.8 needs this syntax instead of AvARRAY = ary */ |
2378 | /* 5.8.8 needs this syntax instead of AvARRAY = ary, yet */ |
|
|
2379 | /* -DDEBUGGING flags this as a bug, despite it perfectly working */ |
|
|
2380 | SvPVX ((SV *)av) = (char *)ary; |
|
|
2381 | #endif |
2375 | AvMAX (av) = 1; |
2382 | AvMAX (av) = 1; |
2376 | AvFILLp (av) = 0; |
2383 | AvFILLp (av) = 0; |
2377 | ary [0] = newSViv (count); |
2384 | ary [0] = newSViv (count); |
2378 | |
2385 | |
2379 | return newRV_noinc ((SV *)av); |
2386 | return newRV_noinc ((SV *)av); |