xs/future.xs

filter: Statementstmt 63.5% 89 / 140 Branchbran 31.9% 55 / 172 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 46.1% 144 / 312 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« xs/websocket.xs ↑ Summary include/fetch/backend_iouring.c »
1 MODULE = Fetch PACKAGE = Fetch::Future
2  
3 # Native array-slot Future, fully XS: creation, resolution, callbacks,
4 # chaining, combinators, and CPAN Future interop (ported from Hyperman).
5 #
6 # The AWAIT_* aliases are the Future::AsyncAwait::Awaitable protocol, which
7 # is how `await $f` reaches a future of this class inside an async sub. They
8 # are aliases rather than wrappers so the protocol costs nothing beyond the
9 # XSUB it already resolves to. AWAIT_CLONE is the exception and carries the
10 # loop pin, for the reason given there.
11  
12 PROTOTYPES: DISABLE
13  
14 BOOT:
15 80 hm_fq = newAV(); /* the future fire queue (see ft_future.h) */
16  
17 SV *
18 new(class)
19 SV *class
20 CODE:
21 {
22 const char *name;
23 46 ▶ if (SvROK(class) && SvOBJECT(SvRV(class)))
Branch: 2 branches
BranchTrueFalseTotal
if (SvROK(class) && SvOBJECT(SvRV(class))) 0 46 46
if (SvROK(class) && SvOBJECT(SvRV(class))) 0 0 0
24 0 ▶ name = HvNAME(SvSTASH(SvRV(class)));
Branch: 6 branches
BranchTrueFalseTotal
name = HvNAME(SvSTASH(SvRV(class))); 0 0 0
name = HvNAME(SvSTASH(SvRV(class))); 0 0 0
name = HvNAME(SvSTASH(SvRV(class))); 0 0 0
name = HvNAME(SvSTASH(SvRV(class))); 0 0 0
name = HvNAME(SvSTASH(SvRV(class))); 0 0 0
name = HvNAME(SvSTASH(SvRV(class))); 0 0 0
25 else
26 46 name = SvPV_nolen(class);
27 46 RETVAL = hmf_new(aTHX_ name);
28 }
29 OUTPUT:
30 RETVAL
31  
32 SV *
33 done(self, ...)
34 SV *self
35 ALIAS:
36 AWAIT_DONE = 1
37 CODE:
38 PERL_UNUSED_VAR(ix);
39 29 ▶ if (hmf_state(aTHX_ self) == HMF_PENDING)
Branch: 1 branch
BranchTrueFalseTotal
if (hmf_state(aTHX_ self) == HMF_PENDING) 29 0 29
40 29 hmf_settle(aTHX_ self, HMF_DONE, &ST(1), items - 1);
41 29 RETVAL = SvREFCNT_inc(self);
42 OUTPUT:
43 RETVAL
44  
45 SV *
46 fail(self, ...)
47 SV *self
48 ALIAS:
49 AWAIT_FAIL = 1
50 CODE:
51 PERL_UNUSED_VAR(ix);
52 4 ▶ if (hmf_state(aTHX_ self) == HMF_PENDING) {
Branch: 1 branch
BranchTrueFalseTotal
if (hmf_state(aTHX_ self) == HMF_PENDING) { 4 0 4
53 4 ▶ if (items > 1) {
Branch: 1 branch
BranchTrueFalseTotal
if (items > 1) { 4 0 4
54 4 hmf_settle(aTHX_ self, HMF_FAILED, &ST(1), items - 1);
55 } else {
56 0 SV *def = sv_2mortal(newSVpvs("Failed\n"));
57 0 hmf_settle(aTHX_ self, HMF_FAILED, &def, 1);
58 }
59 }
60 4 RETVAL = SvREFCNT_inc(self);
61 OUTPUT:
62 RETVAL
63  
64 SV *
65 done_future(class, ...)
66 SV *class
67 ALIAS:
68 AWAIT_NEW_DONE = 1
69 CODE:
70 {
71 0 ▶ const char *name = SvROK(class) ? HvNAME(SvSTASH(SvRV(class)))
Branch: 4 branches
BranchTrueFalseTotal
const char *name = SvROK(class) ? HvNAME(SvSTASH(SvRV(class))) 0 0 0
const char *name = SvROK(class) ? HvNAME(SvSTASH(SvRV(class))) 0 0 0
const char *name = SvROK(class) ? HvNAME(SvSTASH(SvRV(class))) 0 0 0
const char *name = SvROK(class) ? HvNAME(SvSTASH(SvRV(class))) 0 0 0
72 6 ▶ : SvPV_nolen(class);
Branch: 3 branches
BranchTrueFalseTotal
: SvPV_nolen(class); 0 3 3
: SvPV_nolen(class); 0 0 0
: SvPV_nolen(class); 0 0 0
73 PERL_UNUSED_VAR(ix);
74 3 RETVAL = hmf_new(aTHX_ name);
75 3 hmf_settle(aTHX_ RETVAL, HMF_DONE, &ST(1), items - 1);
76 }
77 OUTPUT:
78 RETVAL
79  
80 SV *
81 fail_future(class, ...)
82 SV *class
83 ALIAS:
84 AWAIT_NEW_FAIL = 1
85 CODE:
86 {
87 0 ▶ const char *name = SvROK(class) ? HvNAME(SvSTASH(SvRV(class)))
Branch: 4 branches
BranchTrueFalseTotal
const char *name = SvROK(class) ? HvNAME(SvSTASH(SvRV(class))) 0 0 0
const char *name = SvROK(class) ? HvNAME(SvSTASH(SvRV(class))) 0 0 0
const char *name = SvROK(class) ? HvNAME(SvSTASH(SvRV(class))) 0 0 0
const char *name = SvROK(class) ? HvNAME(SvSTASH(SvRV(class))) 0 0 0
88 2 ▶ : SvPV_nolen(class);
Branch: 3 branches
BranchTrueFalseTotal
: SvPV_nolen(class); 0 1 1
: SvPV_nolen(class); 0 0 0
: SvPV_nolen(class); 0 0 0
89 PERL_UNUSED_VAR(ix);
90 1 RETVAL = hmf_new(aTHX_ name);
91 1 ▶ if (items > 1) {
Branch: 1 branch
BranchTrueFalseTotal
if (items > 1) { 1 0 1
92 1 hmf_settle(aTHX_ RETVAL, HMF_FAILED, &ST(1), items - 1);
93 } else {
94 0 SV *def = sv_2mortal(newSVpvs("Failed\n"));
95 0 hmf_settle(aTHX_ RETVAL, HMF_FAILED, &def, 1);
96 }
97 }
98 OUTPUT:
99 RETVAL
100  
101 SV *
102 cancel(self)
103 SV *self
104 CODE:
105 7 hmf_cancel(aTHX_ self);
106 7 RETVAL = SvREFCNT_inc(self);
107 OUTPUT:
108 RETVAL
109  
110 int
111 is_ready(self)
112 SV *self
113 ALIAS:
114 AWAIT_IS_READY = 1
115 CODE:
116 PERL_UNUSED_VAR(ix);
117 12 ▶ RETVAL = hmf_state(aTHX_ self) != HMF_PENDING;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = hmf_state(aTHX_ self) != HMF_PENDING; 3 9 12
118 OUTPUT:
119 RETVAL
120  
121 int
122 is_done(self)
123 SV *self
124 CODE:
125 4 ▶ RETVAL = hmf_state(aTHX_ self) == HMF_DONE;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = hmf_state(aTHX_ self) == HMF_DONE; 0 4 4
126 OUTPUT:
127 RETVAL
128  
129 int
130 is_failed(self)
131 SV *self
132 CODE:
133 6 ▶ RETVAL = hmf_state(aTHX_ self) == HMF_FAILED;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = hmf_state(aTHX_ self) == HMF_FAILED; 0 6 6
134 OUTPUT:
135 RETVAL
136  
137 int
138 is_cancelled(self)
139 SV *self
140 ALIAS:
141 AWAIT_IS_CANCELLED = 1
142 CODE:
143 PERL_UNUSED_VAR(ix);
144 6 ▶ RETVAL = hmf_state(aTHX_ self) == HMF_CANCELLED;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = hmf_state(aTHX_ self) == HMF_CANCELLED; 0 6 6
145 OUTPUT:
146 RETVAL
147  
148 # A new pending future of the same class. The instance is not modified and
149 # no per-instance state is copied - except the loop, which is not state but
150 # the only thing that can resolve what is cloned from it. An async sub
151 # builds the future it returns by cloning the one it suspended on, and
152 # $Fetch::Future::AWAIT is a single global that the last install_await
153 # wins, so a clone that forgot its loop is awaited on whichever loop
154 # happens to be installed. With more than one loop in the process that is
155 # the wrong one, and the await fails rather than resolving.
156 SV *
157 AWAIT_CLONE(self)
158 SV *self
159 CODE:
160 1 RETVAL = hmf_new(aTHX_ hmf_class_of(aTHX_ self));
161 1 hmf_pin_loop(aTHX_ RETVAL, hmf_pinned_loop(aTHX_ self));
162 OUTPUT:
163 RETVAL
164  
165 SV *
166 on_ready(self, cb)
167 SV *self
168 SV *cb
169 ALIAS:
170 AWAIT_ON_READY = 1
171 CODE:
172 PERL_UNUSED_VAR(ix);
173 1 hmf_on_ready(aTHX_ self, cb);
174 1 RETVAL = SvREFCNT_inc(self);
175 OUTPUT:
176 RETVAL
177  
178 # Run $thing when this future is cancelled: a code reference is called with
179 # the future, anything else is cancelled. Registering on a future that has
180 # already been cancelled runs it at once; on one that completed normally it
181 # is dropped, since that future will never cancel.
182 SV *
183 on_cancel(self, thing)
184 SV *self
185 SV *thing
186 ALIAS:
187 AWAIT_ON_CANCEL = 1
188 AWAIT_CHAIN_CANCEL = 2
189 CODE:
190 {
191 9 IV st = hmf_state(aTHX_ self);
192 PERL_UNUSED_VAR(ix);
193 9 ▶ if (st == HMF_CANCELLED) {
Branch: 1 branch
BranchTrueFalseTotal
if (st == HMF_CANCELLED) { 1 8 9
194 1 hmf_cancel_target(aTHX_ thing, self);
195 8 ▶ } else if (st == HMF_PENDING) {
Branch: 1 branch
BranchTrueFalseTotal
} else if (st == HMF_PENDING) { 7 1 8
196 7 SV *cb = hm_closure(aTHX_ hm_xs_oncancel_cb, NULL, thing,
197 NULL, NULL, 0, 0);
198 7 hmf_on_ready(aTHX_ self, cb);
199 7 SvREFCNT_dec(cb);
200 }
201 9 RETVAL = SvREFCNT_inc(self);
202 }
203 OUTPUT:
204 RETVAL
205  
206 SV *
207 on_done(self, usercb)
208 SV *self
209 SV *usercb
210 ALIAS:
211 on_fail = 1
212 CODE:
213 {
214 3 ▶ SV *cb = hm_closure(aTHX_ hm_xs_ondone_cb, NULL, usercb, NULL, NULL,
Branch: 1 branch
BranchTrueFalseTotal
SV *cb = hm_closure(aTHX_ hm_xs_ondone_cb, NULL, usercb, NULL, NULL, 1 2 3
215 ix == 0 ? HMF_DONE : HMF_FAILED, 0);
216 3 hmf_on_ready(aTHX_ self, cb);
217 3 SvREFCNT_dec(cb);
218 3 RETVAL = SvREFCNT_inc(self);
219 }
220 OUTPUT:
221 RETVAL
222  
223 SV *
224 await(self)
225 SV *self
226 CODE:
227 0 hmf_await(aTHX_ self);
228 0 RETVAL = SvREFCNT_inc(self);
229 OUTPUT:
230 RETVAL
231  
232 void
233 get(self)
234 SV *self
235 ALIAS:
236 result = 1
237 AWAIT_WAIT = 2
238 AWAIT_GET = 3
239 PPCODE:
240 {
241 IV st;
242 /* AWAIT_GET is defined only on a future that is already ready, so it
243 * reads the result where every other spelling waits for one.
244 * AWAIT_WAIT is the spelling that does wait - it is what a toplevel
245 * await resolves to. */
246 179 ▶ if (ix == 3) {
Branch: 1 branch
BranchTrueFalseTotal
if (ix == 3) { 6 173 179
247 6 st = hmf_state(aTHX_ self);
248 6 ▶ if (st == HMF_PENDING) croak("Fetch::Future is not ready");
Branch: 1 branch
BranchTrueFalseTotal
if (st == HMF_PENDING) croak("Fetch::Future is not ready"); 1 5 6
249 } else {
250 173 hmf_await(aTHX_ self);
251 172 st = hmf_state(aTHX_ self);
252 }
253 177 ▶ if (st == HMF_FAILED) {
Branch: 1 branch
BranchTrueFalseTotal
if (st == HMF_FAILED) { 17 160 177
254 17 AV *fav = hmf_values_av(aTHX_ self);
255 17 ▶ SV **e = fav ? av_fetch(fav, 0, 0) : NULL;
Branch: 1 branch
BranchTrueFalseTotal
SV **e = fav ? av_fetch(fav, 0, 0) : NULL; 17 0 17
256 17 ▶ if (e) croak_sv(sv_mortalcopy(*e));
Branch: 1 branch
BranchTrueFalseTotal
if (e) croak_sv(sv_mortalcopy(*e)); 17 0 17
257 0 croak("Failed");
258 }
259 160 ▶ if (st == HMF_CANCELLED)
Branch: 1 branch
BranchTrueFalseTotal
if (st == HMF_CANCELLED) 0 160 160
260 0 croak("Fetch::Future was cancelled");
261 {
262 160 AV *rav = hmf_values_av(aTHX_ self);
263 160 ▶ SSize_t n = rav ? av_len(rav) + 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
SSize_t n = rav ? av_len(rav) + 1 : 0; 160 0 160
264 160 ▶ if (GIMME_V == G_ARRAY) {
Branch: 1 branch
BranchTrueFalseTotal
if (GIMME_V == G_ARRAY) { 7 153 160
265 SSize_t i;
266 7 ▶ EXTEND(SP, n);
Branch: 2 branches
BranchTrueFalseTotal
EXTEND(SP, n); 7 0 7
EXTEND(SP, n); 0 7 7
267 17 ▶ for (i = 0; i < n; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i = 0; i < n; i++) { 10 7 17
268 10 SV **e = av_fetch(rav, i, 0);
269 10 ▶ PUSHs(e ? sv_mortalcopy(*e) : &PL_sv_undef);
Branch: 1 branch
BranchTrueFalseTotal
PUSHs(e ? sv_mortalcopy(*e) : &PL_sv_undef); 10 0 10
270 }
271 153 ▶ } else if (n) {
Branch: 1 branch
BranchTrueFalseTotal
} else if (n) { 153 0 153
272 153 SV **e = av_fetch(rav, 0, 0);
273 153 ▶ XPUSHs(e ? sv_mortalcopy(*e) : &PL_sv_undef);
Branch: 2 branches
BranchTrueFalseTotal
XPUSHs(e ? sv_mortalcopy(*e) : &PL_sv_undef); 0 153 153
XPUSHs(e ? sv_mortalcopy(*e) : &PL_sv_undef); 153 0 153
274 } else {
275 0 ▶ XPUSHs(&PL_sv_undef);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(&PL_sv_undef); 0 0 0
276 }
277 }
278 }
279  
280 void
281 failure(self)
282 SV *self
283 PPCODE:
284 {
285 3 hmf_await(aTHX_ self);
286 3 ▶ if (hmf_state(aTHX_ self) != HMF_FAILED) XSRETURN_EMPTY;
Branch: 1 branch
BranchTrueFalseTotal
if (hmf_state(aTHX_ self) != HMF_FAILED) XSRETURN_EMPTY; 0 3 3
287 {
288 3 AV *fav = hmf_values_av(aTHX_ self);
289 3 ▶ SSize_t n = fav ? av_len(fav) + 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
SSize_t n = fav ? av_len(fav) + 1 : 0; 3 0 3
290 3 ▶ if (GIMME_V == G_ARRAY) {
Branch: 1 branch
BranchTrueFalseTotal
if (GIMME_V == G_ARRAY) { 0 3 3
291 SSize_t i;
292 0 ▶ EXTEND(SP, n);
Branch: 2 branches
BranchTrueFalseTotal
EXTEND(SP, n); 0 0 0
EXTEND(SP, n); 0 0 0
293 0 ▶ for (i = 0; i < n; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i = 0; i < n; i++) { 0 0 0
294 0 SV **e = av_fetch(fav, i, 0);
295 0 ▶ PUSHs(e ? sv_mortalcopy(*e) : &PL_sv_undef);
Branch: 1 branch
BranchTrueFalseTotal
PUSHs(e ? sv_mortalcopy(*e) : &PL_sv_undef); 0 0 0
296 }
297 3 ▶ } else if (n) {
Branch: 1 branch
BranchTrueFalseTotal
} else if (n) { 3 0 3
298 3 SV **e = av_fetch(fav, 0, 0);
299 3 ▶ XPUSHs(e ? sv_mortalcopy(*e) : &PL_sv_undef);
Branch: 2 branches
BranchTrueFalseTotal
XPUSHs(e ? sv_mortalcopy(*e) : &PL_sv_undef); 0 3 3
XPUSHs(e ? sv_mortalcopy(*e) : &PL_sv_undef); 3 0 3
300 }
301 }
302 }
303  
304 void
305 _values(self)
306 SV *self
307 PPCODE:
308 {
309 0 AV *rav = hmf_values_av(aTHX_ self);
310 0 ▶ SSize_t i, n = rav ? av_len(rav) + 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
SSize_t i, n = rav ? av_len(rav) + 1 : 0; 0 0 0
311 0 ▶ EXTEND(SP, n);
Branch: 2 branches
BranchTrueFalseTotal
EXTEND(SP, n); 0 0 0
EXTEND(SP, n); 0 0 0
312 0 ▶ for (i = 0; i < n; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i = 0; i < n; i++) { 0 0 0
313 0 SV **e = av_fetch(rav, i, 0);
314 0 ▶ PUSHs(e ? sv_mortalcopy(*e) : &PL_sv_undef);
Branch: 1 branch
BranchTrueFalseTotal
PUSHs(e ? sv_mortalcopy(*e) : &PL_sv_undef); 0 0 0
315 }
316 }
317  
318 SV *
319 then(self, ...)
320 SV *self
321 ALIAS:
322 else = 1
323 CODE:
324 {
325 3 SV *on_done = NULL, *on_fail = NULL;
326 SV *cb;
327 3 ▶ if (ix == 0) {
Branch: 1 branch
BranchTrueFalseTotal
if (ix == 0) { 2 1 3
328 2 ▶ if (items > 1 && SvOK(ST(1))) on_done = ST(1);
Branch: 2 branches
BranchTrueFalseTotal
if (items > 1 && SvOK(ST(1))) on_done = ST(1); 2 0 2
if (items > 1 && SvOK(ST(1))) on_done = ST(1); 2 0 2
329 2 ▶ if (items > 2 && SvOK(ST(2))) on_fail = ST(2);
Branch: 2 branches
BranchTrueFalseTotal
if (items > 2 && SvOK(ST(2))) on_fail = ST(2); 0 2 2
if (items > 2 && SvOK(ST(2))) on_fail = ST(2); 0 0 0
330 } else {
331 1 ▶ if (items > 1 && SvOK(ST(1))) on_fail = ST(1);
Branch: 2 branches
BranchTrueFalseTotal
if (items > 1 && SvOK(ST(1))) on_fail = ST(1); 1 0 1
if (items > 1 && SvOK(ST(1))) on_fail = ST(1); 1 0 1
332 }
333 3 RETVAL = hmf_new(aTHX_ hmf_class_of(aTHX_ self));
334 3 hmf_set_upstream(aTHX_ RETVAL, self);
335 3 cb = hm_closure(aTHX_ hm_xs_then_cb, RETVAL, on_done, on_fail, NULL, 0, 0);
336 3 hmf_on_ready(aTHX_ self, cb);
337 3 SvREFCNT_dec(cb);
338 }
339 OUTPUT:
340 RETVAL
341  
342 SV *
343 followed_by(self, usercb)
344 SV *self
345 SV *usercb
346 CODE:
347 {
348 SV *cb;
349 0 RETVAL = hmf_new(aTHX_ hmf_class_of(aTHX_ self));
350 0 hmf_set_upstream(aTHX_ RETVAL, self);
351 0 cb = hm_closure(aTHX_ hm_xs_then_cb, RETVAL, usercb, NULL, NULL, 1, 0);
352 0 hmf_on_ready(aTHX_ self, cb);
353 0 SvREFCNT_dec(cb);
354 }
355 OUTPUT:
356 RETVAL
357  
358 SV *
359 transform(self, ...)
360 SV *self
361 CODE:
362 {
363 1 SV *xd = NULL, *xf = NULL;
364 SV *cb;
365 int i;
366 1 ▶ if ((items - 1) % 2)
Branch: 1 branch
BranchTrueFalseTotal
if ((items - 1) % 2) 0 1 1
367 0 croak("transform: odd number of arguments");
368 2 ▶ for (i = 1; i + 1 < items; i += 2) {
Branch: 1 branch
BranchTrueFalseTotal
for (i = 1; i + 1 < items; i += 2) { 1 1 2
369 1 const char *key = SvPV_nolen(ST(i));
370 1 ▶ if (strEQ(key, "done")) xd = ST(i + 1);
Branch: 1 branch
BranchTrueFalseTotal
if (strEQ(key, "done")) xd = ST(i + 1); 1 0 1
371 0 ▶ else if (strEQ(key, "fail")) xf = ST(i + 1);
Branch: 1 branch
BranchTrueFalseTotal
else if (strEQ(key, "fail")) xf = ST(i + 1); 0 0 0
372 0 else croak("transform: unknown argument '%s'", key);
373 }
374 1 RETVAL = hmf_new(aTHX_ hmf_class_of(aTHX_ self));
375 1 hmf_set_upstream(aTHX_ RETVAL, self);
376 1 cb = hm_closure(aTHX_ hm_xs_transform_cb, RETVAL, xd, xf, NULL, 0, 0);
377 1 hmf_on_ready(aTHX_ self, cb);
378 1 SvREFCNT_dec(cb);
379 }
380 OUTPUT:
381 RETVAL
382  
383 void
384 _set_upstream(derived, upstream)
385 SV *derived
386 SV *upstream
387 CODE:
388 0 hmf_set_upstream(aTHX_ derived, upstream);
389  
390 SV *
391 wait_all(class, ...)
392 SV *class
393 ALIAS:
394 wait_any = 1
395 needs_all = 2
396 needs_any = 3
397 CODE:
398 {
399 static const IV modes[4] = { HM_COMB_WAIT_ALL, HM_COMB_WAIT_ANY,
400 HM_COMB_NEEDS_ALL, HM_COMB_NEEDS_ANY };
401 6 RETVAL = hmf_combine(aTHX_ class, &ST(1), items - 1, modes[ix]);
402 }
403 OUTPUT:
404 RETVAL
405  
406 SV *
407 as_cpan_future(self)
408 SV *self
409 CODE:
410 {
411 SV *cf, *cb;
412 0 dSP;
413 int n;
414 0 load_module(PERL_LOADMOD_NOIMPORT, newSVpvs("Future"), NULL);
415 0 ENTER; SAVETMPS;
416 0 ▶ PUSHMARK(SP);
Branch: 1 branch
BranchTrueFalseTotal
PUSHMARK(SP); 0 0 0
417 0 ▶ XPUSHs(sv_2mortal(newSVpvs("Future")));
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(sv_2mortal(newSVpvs("Future"))); 0 0 0
418 0 PUTBACK;
419 0 n = call_method("new", G_SCALAR);
420 0 SPAGAIN;
421 0 ▶ cf = n ? SvREFCNT_inc(POPs) : &PL_sv_undef;
Branch: 1 branch
BranchTrueFalseTotal
cf = n ? SvREFCNT_inc(POPs) : &PL_sv_undef; 0 0 0
422 0 ▶ PUTBACK; FREETMPS; LEAVE;
Branch: 1 branch
BranchTrueFalseTotal
PUTBACK; FREETMPS; LEAVE; 0 0 0
423 0 cb = hm_closure(aTHX_ hm_xs_tocpan_cb, cf, NULL, NULL, NULL, 0, 0);
424 0 hmf_on_ready(aTHX_ self, cb);
425 0 SvREFCNT_dec(cb);
426 0 RETVAL = cf;
427 }
428 OUTPUT:
429 RETVAL
430  
431 SV *
432 from_future(class, other)
433 SV *class
434 SV *other
435 CODE:
436 {
437 0 ▶ const char *name = SvROK(class) ? HvNAME(SvSTASH(SvRV(class)))
Branch: 4 branches
BranchTrueFalseTotal
const char *name = SvROK(class) ? HvNAME(SvSTASH(SvRV(class))) 0 0 0
const char *name = SvROK(class) ? HvNAME(SvSTASH(SvRV(class))) 0 0 0
const char *name = SvROK(class) ? HvNAME(SvSTASH(SvRV(class))) 0 0 0
const char *name = SvROK(class) ? HvNAME(SvSTASH(SvRV(class))) 0 0 0
438 0 ▶ : SvPV_nolen(class);
Branch: 3 branches
BranchTrueFalseTotal
: SvPV_nolen(class); 0 0 0
: SvPV_nolen(class); 0 0 0
: SvPV_nolen(class); 0 0 0
439 SV *cb;
440 0 RETVAL = hmf_new(aTHX_ name);
441 0 cb = hm_closure(aTHX_ hm_xs_fromcpan_cb, RETVAL, NULL, NULL, NULL, 0, 0);
442 0 hm_any_on_ready(aTHX_ other, cb);
443 0 SvREFCNT_dec(cb);
444 }
445 OUTPUT:
446 RETVAL
« xs/websocket.xs ↑ Summary include/fetch/backend_iouring.c »